Say I setup my app.config to specify a type that my current application knows nothing about. Then I use AppDomain.Load(byte[]) to load the assembly before instantiating an instance of my WindsorContainer.
Can Windsor resolve the type? Here's an example:
Castle config:
<castle>
<components>
<component id="test" service="Application.Services.ITestService, Application.Services" type="TestLibrary.TestService, TestLibrary"/>
</components>
</castle>
Then in my code:
byte[] buffer = File.ReadAllBytes("TestLibrary.dll");
AppDomain.CurrentDomain.Load(buffer);
/* the assembly is now loaded and if I iterate AppDomain.GetAssemblies() is shows there */
WindsorContainer container = new WindsorContainer(new XmlInterpreter());/* here I get "The type name TestLibrary.TestService, TestLibrary could not be located" */
ITestService resolvedService = container.Resolve<ITestService>("test");
Edit:
I've found that this does work:
Assembly testLibrary = Assembly.LoadFile("TestLibrary.dll");
AppDomain.CurrentDomain.Load(testLibrary.GetName());
WindsorContainer container = new WindsorContainer(new XmlInterpreter());
ITestService service = container.Resolve<ITestService>("test");