开发者

Any definitive guide for using Unity with an ASP.NET MVC site that hosts one or more web services?

开发者 https://www.devze.com 2022-12-22 14:31 出处:网络
I\'m struggling to find a decent walkthrough for this issue, and was hoping that someone could shed some light on this... I\'ve built an application using a ton of Unity and DI, and I need to pull a f

I'm struggling to find a decent walkthrough for this issue, and was hoping that someone could shed some light on this... I've built an application using a ton of Unity and DI, and I need to pull a few components into a web site and run a WCF service now with them. host a WCF service for clients to connect to it instead of having it included as part of the main application (multi-user scenario where I'm hosting the database for them.)

I've searched and found several documents, but they seem to be focused on running a single service, instead of writing a framework to do the dirty work for me.

I'm wondering, as I've said in the topic, has anyone found "the difinitive开发者_开发百科 guide" on doing this?


Doing a little more research, i did find a few things on how to get the dependency injection to work, where you are implementing/extending an instance provider, a Service Behavior, and a Service Host class... and then in your website, you build a ServiceHostFactory that does the wire-ups from the concrete methods to your interfaces. The only piece of the puzzle I have yet to discover is how you now use *.dlls that have a class which implements IModule, and have the site discover it on the fly.


Discovery on the fly sounds a lot like an extensibility/Add-In scenario. In that case, the Managed Extensibility Framework (MEF) might be a good fit for you.

Despite what many people think, it's also available for .NET 3.5.

0

精彩评论

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