I have just started using StructureMap, having previously worked with Spring.Net. I love the DefaultConventionScanner and the ability to scan assemblies and use convention over configuration to find classes. But there seems to be a limitation that the classes that implement the interfaces must be public, whereas we like to keep out interfaces public and our implementations internal to an assembly.
Is there a way to ask the DefaultConventionScanner to find internal classes as well?
No, and in fact the limitation that classes should be public applies to all of StructureMap - not just the convention scanners. You can register internal types manually with StructureMap if you make use of the InternalsVisibleTo attribute, but it is not well-supported or documented. You will not be able to make an ITypeScanner (like DefaultConventionScanner) that registers internal types because the AssemblyScanner only exposes exported types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With