I have multiple implementations of an interface IStartup
that I need to resolve from a CompositionContainer
. Some implementations have an [ImportingConstructor]
whose imports are satisfied by another DLL.
It seems that the default behavior when I container.GetExports<IStartup>()
will return all the IStartup
implementations that are resolvable and skip those that are not (I understand that most containers work this way). So if a dev forgets to reference an assembly the program will run like nothing is wrong.
How can I detect this condition? I would like to throw an exception if that is the case.