I developed WCF service with InstanceContextmode set to single and hosted by IIS. Periodically, the service is probably restarted by IIS. How can we adjust the way IIS manages the lifetime of this service in singleinstance mode?
Asked
Active
Viewed 73 times
2 Answers
0
I highly recommend you not to host your WCF service inside IIS. There is a simple and minimal way to self-hosting. By self-hosting, I mean that your WCF app hosted itself inside ITSELF. Here is a good sample code for that: https://github.com/amiru3f/ws-security After self-hosting, you can simply create a windows service with nssm to ignore deprecated weak IIS.

Amir
- 1,214
- 7
- 10
0
You can try the following methods:
Click Settings in the operation box on the right side of IIS.
Change Startmode from Ondemand to alwaysrunning.
Then set up the hosted wcf service, enter Advanced settings and set preload enabled to true.

Theobald Du
- 824
- 4
- 7