0

I have an ASP .NET WebSite project (Web Forms) hosted on IIS 7 but I need to execute the application_start (Global.asax) because I load some stuffs there., so I'm looking for a way to execute this code right after I publish the code and/or when IIS restart,

I don't need to debug, I just need to run a process in the application_start to load the cache info in a background process.,

So the first time I open the website be able to run it fast and all cache data will be available, and the application_start runs the first time the website is executed/opened so that's why I need to find an automatic way to execute the application_start right after the IIS is restarted or the website is published., right now I need to manually open the website

ronen tag
  • 1
  • 1
  • 1
    Possible duplicate of [Application\_start not working](https://stackoverflow.com/questions/25973106/application-start-not-working) – mjw Jun 26 '17 at 18:20
  • https://serverfault.com/questions/590865/how-can-i-warm-up-my-asp-net-mvc-webapp-after-an-app-pool-recycle, https://stackoverflow.com/questions/9658849/iis-app-pool-restart-and-asp-net, please read [ask] and share your research. – CodeCaster Jun 26 '17 at 18:20
  • cool, let me try that.. – ronen tag Jun 26 '17 at 18:28

1 Answers1

0

What you need is Application Initialization module in IIS.The original article is quite overwhelming ,a

  • install the Application Initialization Module
  • After the feature has been installed and you have configured an ASP.NET web site, set the startMode of the application pool to AlwaysRunning.

(set the startMode in IIS

Setting the startMode will start the Application and thus >will trigger your Application_Start in global.asax.

Rohith
  • 5,527
  • 3
  • 27
  • 31