I have a requirement where I'd like to configure a plugin for an interface to always be a default type, but allow another assembly's configuration of that same plugin always take precedence.
So say I have MyAssembly.dll, which has a registry that sets this up:
For<IBar>().Use<BarImpl>();
If a particular client needs a different functionality, I want to drop MyAssembly.CustomerA.dll into the bin folder of the application. Its registry will be similar:
For<IBar>().Use<CustomerABarImpl>();
The configuration in in MyAssembly.CustomerA.dll should ALWAYS override the configuration.
I've read that profiles can do this, but that seems to imply I need to set which profile the application should use. I'd rather not if I can; the presense of the MyAssembly.CustomerA.dll should be enough.
Now, this question is similar: Using StructureMap, when a default concrete type is defined in one registry, can it be redefined in another registry?
But I don't want to leave it to "whatever StructureMap finds last."
Can this be done?