How to autostart asp.net application in IIS10

I am trying to get an ASP.NET application to start automatically whenever the application pool is started.

In accordance with lots and lots of links online, I have already done the following:

  • Set the application pool to StartMode=AlwaysRunning
  • Set the site of interest (which belongs to the considered pool) to preloadEnabled=true
  • Install Application InitializationWindows Setup
  • Add <applicationInitialization>node to web.config <system.webServer>node

The web application is based on Owin and has an easy way to log log4net into it Startup.Configuration(). Now when IIS restarts, I see that the w3svc.exe process is running, so I know what works StartMode=AlwaysRunning. However, messages are not logged in the log file.

Going to any URL (even non-existent) in the application will launch the application and add a log line.

Due to the real work being done when the application starts, I really want the application to really load, but I seem to be unable to do this.

Search on this site, unfortunately, I could not find a solution.

Thanks in advance.

+4
source share
1 answer

To answer my question for future generations, it seems that I was on the right track. To run the application in IIS10 (and I assume that in IIS 8), you only need the following three steps:

  • Install the application pool on StartMode=AlwaysRunningto ensure that the w3svc.exe process is always running for the application pool.
  • ( ) preloadEnabled=true
  • Application Initialization Windows .

, Application Initialization ​​ , . , , , : (

, , , - (, Quartz NuGet).

, , , .

+9

Source: https://habr.com/ru/post/1623097/


All Articles