How to properly autostart an asp.net application in IIS10

前端 未结 1 1352
情书的邮戳
情书的邮戳 2020-12-25 07:53

I\'m trying to get my ASP.NET application to automatically start whenever the application pool is running.

As per the lots and lots of references online I have alrea

相关标签:
1条回答
  • 2020-12-25 08:28

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

    1. Set the Application Pool to StartMode=AlwaysRunning to make sure the w3svc.exe process is always running for the App Pool.
    2. Set the site in question (that belongs to beforementioned Pool) to preloadEnabled=true
    3. Install the Application Initialization feature to the Windows installation as per the instructions here.

    One important thing to note is that if the Application Initialization task was not previously installed on the machine you must reboot the machine. This is what I missed the last time which led to quite some time wasted looking for other things :(

    Anyway, setting up those three things will cause the app to actually go through it's initialization, which is especially useful if you want to setup some scheduling task (ea using the Quartz NuGet package).

    Note by the way that if you setup auto initialization like above, the application will also automatically start after the shutdown timeout has expired and on application pool recycles.

    0 讨论(0)
提交回复
热议问题