I have an WCF site on IIS 7. The site is rarely being accessed which causes the application to unload. How can I keep the application (WCF) up all the time?
相关问题
- How to make a .svc file write to asp.net Trace.axd
- WCF Service Using Client Certificates Requires Ano
- How to deploy python flask application in conda ba
- WCF error with net.tcp "The service endpoint faile
- WCF Service Reference Support Files Not Updating
There are a couple of options.
Lastly, under .NET Framework 4.0 you have the option to keep apps alive indefinitely. I doubt you are on 4.0 yet, but it's one thing to consider.
There's no reason to stop using IIS. All you need to do is set the application pool options so that the service is never shutdown due to inactivity. Unfortunately the defaults are something like 20 minutes of inactivity and every 29hrs regardless.
What I would suggest is:
Fun trivia: the reason the default recycling is 29hrs is because this will cause a recycling every day, but 5hrs later each day so that the time of day is never the same.
For more on configuring application pools, check out this section on TechNet titled Managing Application Pools which covers the topics I've mentioned above as well as many others.
Host it in a Windows Service, instead of depending on IIS (as marc_s and Nissan Fan state).
http://msdn.microsoft.com/en-us/library/ms733069.aspx