开发者

IoC container conflict

开发者 https://www.devze.com 2023-01-26 21:54 出处:网络
In my current project I\'m using SolrNet and OAuth.Net. Both libraries use Common Service Locator. SolrN开发者_如何学Pythonet set as a locator provider a custom IoC container implementation. The locat

In my current project I'm using SolrNet and OAuth.Net. Both libraries use Common Service Locator. SolrN开发者_如何学Pythonet set as a locator provider a custom IoC container implementation. The locator provider for OAuth.Net is set in my code (currently I'm using Windsor as it is used in the examples). And the problem starts here because

ServiceLocator.SetLocatorProvider()

actually is replacing the ServiceLocator.Current static property value.

Any advice? What are the best practices in such a scenario?

Thanks in advance, Hristo


If you're already using Windsor, set up SolrNet using the included Windsor facility instead of the built-in container.

0

精彩评论

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