0

I have several WCF services in one Web Project, this web project is hosted on IIS. Is it possible to handle when IIS start a process and shutdown it.

All that i need is to save some data from memory to DB when all my services are stopped and load those data back to memory when services are started again.

Disposer
  • 667
  • 1
  • 7
  • 23
  • The answer will depend on your version of IIS and whether you are using WAS activated endpoints like net.tcp vs. IIS activated endpoints like HTTP. – BrandonZeider Jul 13 '11 at 00:20
  • IIS will by default launch the WCF service "on demand" - when a request comes in - and the WCF service class will only be present for the duration of the request. As long as no request is pending, the WCF service code won't be present in memory. – marc_s Jul 13 '11 at 04:12

1 Answers1

1

Without know more about your version of IIS, whether you're using WAS activated endpoints like net.tcp, etc, this SO question is a good place to start.

Short version: the easy route is to use the Application_Start event in Global.asax for HTTP endpoints if that works for you.

Community
  • 1
  • 1
BrandonZeider
  • 8,014
  • 2
  • 23
  • 20