tags:

views:

230

answers:

1

Hi!

I'm programming a WCF service that internally relies heavily on Inversion of Control. I would like to bootstrap / initialize my IoC container inside a custom ServiceHostFactory. I've read some examples of different hooks that are available, but none of them seem to work for me.

This approach is the one I'd prefer to use (custom IServiceBehavior, IInstanceProvider, ServiceHost and ServiceHostFactory) but the last step is to signal to the service to use my custom ServiceHostFactory inside my serivce's *.svc-file. I don't have one of those since the project type is a WCF Service Library - not a WCF Service Application. Is there a way I can tell WCF to use my ServiceHostFactory in the App.config file?

A: 

As I don't see an anwer, I'll post what I found, which is not very encouraging.

All references to ServiceHostFactory point to the svc file and the Factory attribute, which is not what you are looking for.

This thread on MSDN even tells that it is not possible to do what you are trying to achieve.

Sorry...

Timores
I went ahead and reimplemented the service using the WCF Service Application instead... Not what I wanted, but I'd rather have IoC than not.
Ciddan