I have some scheduled jobs that need to be run in the Application_Start but as far as I know, this method only get triggered after the first request. Is there anyway I can just auto startup the application after I stop and start the connection in IIS or stop/start/restart the site?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you are on IIS 7.5, you can setup the application auto start, as you can see on this post on the ScottGu blog.
Basically, you have to add the startMode=”AlwaysRunning”
attribute on the application host config file, in the app worker process entry.