问题
I am using IIS7.5 to force my web app to load automatically (startMode="AlwaysRunning"
), and I now want to preload my cache data. I am a bit confused though because two approaches seem identical:
- use
Application_Start
in global.asax - use
serviceAutoStartProviders
in IIS config files
They seem rather redundant and doing the same thing. If they are, I guess I would rather use Application_Start
than create code dependencies in IIS configuration files. Any advice?
回答1:
The Application_Start
in the global.asax is fired when the application receives it's first request (first user or autostart) so it is not used to start the site.
Use serviceAutoStartProviders
to start
http://www.asp.net/whitepapers/aspnet4#0.2__Toc253429241
The IIS Application Warm-Up Module is easier to use http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization
来源:https://stackoverflow.com/questions/28559553/application-start-vs-serviceautostartproviders