开发者

Castle Windsor and registering types from in memory assemblies; is it possible?

We have an applicaion which compiles a number of code classes to an number of in memory assemblies when it starts up. I've being trying to register these types in Castle Windsor but it cannot instantiate them; it says type types cannot be found.

Does anyone know if this is possible? I'm using an XML Configuration file and have the DLL's compiled before I instantiate the Windsor Container. Below is an example of the configuration I am using; I do not specify the DLL name in 开发者_开发问答the type declaration here as there is no physical DLL on disk.

   <!-- Register the Filtering provider, which is specified in the custom script -->
    <component id="FilteringProvider" 
               type="Optimus.Scripts.Filtering.FilteringProvider"
               service="Optimus.Filtering.Lib.IFilteringProvider, Optimus.Filtering.Lib"
               >
    </component>

Kind Regards Noel


You can register components from code, in a specific assembly :

container.Register(
    AllTypes.Of<IService>()
    .FromAssembly(myAssemly));

Here you will pass your dynamically compiled assembly.

http://docs.castleproject.org/Windsor.Registering-components-by-conventions.ashx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜