i’m trying to get auto registration to work for assemblies added to the Scan operation. Currently only the types in the current assembly are being registered – any types that are added to the scan do not get registered automatically (i have to add them by hand).
I know the assembly is getting pulled in because i have a Registry class within the assembly containing LogService whose types are getting registered.
Is there some switch i’m missing or other simple reason why this doesnt work??
I’m using version 2.6.4.1
thanks for any help
this is my scan. I want all the types to be autoregistered that live in the assembly containing LogService:
scan =>
{
scan.TheCallingAssembly();
scan.AssemblyContainingType< LogService >();
scan.LookForRegistries();
scan.WithDefaultConventions();
}
You can configure which assemblies are included in StructureMap auto-registration by using the
Assemblymethod of theIAssemblyScanner. Documentation is available at http://docs.structuremap.net/ScanningAssemblies.htmUpdate It seems like you’ve got the right idea. The part your missing is where you register each previously loaded assembly. You can get these from the
AppDomain, by usingAppDomain.CurrentDomain.GetAssemblies(). You should be able to figure out the rest without difficulty