Castle Windsor Referencing a Service in a Framework Library
I have been googling for ages today and yeste开发者_C百科rday and am completely frustrated with Castle Windsor. I am trying to use DI to inject a custom membership provider into my controller class. The problem is that in my config file i refer to the service that i am implementing, in this case the abstract class MembershipProvider contained in System.Web, but i get the error at runtime "Could not convert from 'System.Web.Security.MembershipProvider,System.Web'to System.Type - Maybe type could not be found. My controller factory is all setup and working so i know that everything works but it just doesnt work with referencing system.web it seems like, i dont know. Here is my code in my web.config.
<castle>
<components>
<component id="MyMembership" service="System.Web.Security.MembershipProvider,System.Web"
type="UserManagement.CustomMembership,UserManagement" lifestyle="PerWebRequest" />
</components>
</castle>
so in this case i have my component id, the service is the abstract class MembershipProvider in System.Web assembly, then the type i wish to supply is the fully qualified type above in the UserManagement assembly. I just cant get it to work!
You need to deploy UserManagement.dll
精彩评论