I have a WCF service that’s hosted on IIS 7 using a basicHttpBinding. The service is acting as a controller for other services distrubted on several machines, known as clients.
The service is configured to be Single ContextMode with Multiple ConurrecnyMode. So that it would keep the state of the object. My problem is after a certain period of inactivity, I see the service invoking the constructor again and thus it loses all its state! Any suggestions to make this service live forever?
Thanks!
It sounds like IIS is recycling your service. Keep this in mind (excerpted from Internet Information Services Hosting Best Practices):
While it is possible to disable recycling, if you you need to be IIS-hosted and you care about state, you should probably put it in a durable location.