Using the Custom ServiceHostFactory in a WCF Services Library Project

2 answers

Since I do not see anwer, I will post what I found, which is not very encouraging.

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

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

Unfortunately...

+3
source

Ciddan, glad to see you found a resolution (albeit not ideal). I had the same question as you, and finally decided to use IIS to host the service and connected my custom Ioc classes (which are in my WCF Service Library) using the serviceHostingEnvironment service in my web.config. Something like that:

<serviceHostingEnvironment multipleSiteBindingsEnabled="true"> <serviceActivations> <add relativeAddress="./Service1.svc" service="WcfServiceLibrary1.Service1" factory="WcfServiceLibrary1.IocServiceHostFactory, WcfServiceLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> </serviceActivations> </serviceHostingEnvironment> 

"./Service1.svc" is my file service, where WcfServiceLibrary1.Service1 is a specific imp. I hit a few stumbling blocks, but eventually managed to encapsulate Ioc from the WCF Service Library.

This blog post has been very helpful and contains some great tips.

+7
source

Source: https://habr.com/ru/post/1308731/


All Articles