views:

29

answers:

1

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.

A: 

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.

Mark Seemann
Hmm... I thought that as well, but had hoped that maybe there is a way whereas the same functionality could be done using the structure(s) that I had built already... oh well :)
Richard B
Since you are using Unity, you can use its XML configuration to enable late binding, but that requires you to update the .config file every time you want to add a new module. That's hardly *on the fly*, so I presume it doesn't apply in your case...
Mark Seemann