I have a requirement to use a plug in model where I need to allow types of ITask to be created by structuremap but where I only have a string of the type name at runtime. These types need to use Ctor injection to be composed, so I can’t build up an existing type.
Also, I don’t want to get all types and then query the type name as they could be expensive to construct.
Is there any built in functionality I am missing?
I haven’t tried this, but maybe you could use Type.GetType, like…
This assumes you know the assembly/namespaces of the types.
see http://msdn.microsoft.com/en-us/library/w3f99sx1.aspx
Another possibility…
In your scanner add this
Then, in some resolver class…