static void

ASP.Net Core in IIS

Asp.Net Core 2.2 introduced InProcess hosting for IIS (with the module AspNetCoreModuleV2). It is now default and faster than the old OutOfProcess Kestrel model (and the old AspNetCoreModule IIS module). You can set it back with AspNetCoreHostingModel

Install the Asp Core Hosting Bundle on the server (Core runtime + the IIS module)


The web.config only appears on "Publish" but you can add one to the project and the <aspNetCore> element will be transformed during Publish with your project dll/exe name.

<?xml version="1.0" encoding="utf-8"?>
  <location path="." inheritInChildApplications="false">
        <add name="aspNetCore" 
             path="*" verb="*" 
             resourceType="Unspecified" />
        hostingModel="inprocess" />

This is framework dependent (not self contained)- using dotnet.exe to call the dll:


You can set environmental variables for the process within the aspNetCore element

            name="ASPNETCORE_ENVIRONMENT" value="ACC" />
        <!-- also handlerSettings @name="debugFile" and "debugLevel" 
        are useful for debugging  -->

If you get it wrong, you get cryptic errors like HTTP Error 500.30 - ANCM In-Process Start Failure. Check the event log and turn on stdout (perhaps with handlerSettings/debugLevel).

.Net Core 1 Core always runs using it's own web server, Kestrel. It can then be self-hosted, or run on Linux, but for most windows servers, you'll probably run it with IIS, as always has been.

Hence, in Program.cs, you see both .UseKestrel and .UseIISIntegration.

See for details and potential errors


public static void Main(string[] args)
    var host = new WebHostBuilder(args)