title: .NET Core 2.2 - "HTTP Error 500.30 - ANCM In-Process Start Failure"
body: <p>When hosting an ASP.NET Core MVC application on <a href="https://en.wikipedia.org/wiki/Windows_Server_2016" rel="nofollow noreferrer">Windows Server 2016</a> data center running IIS 10, the application fails to load with the message:</p>
  <blockquote>
  <p>HTTP Error 500.30 - ANCM In-Process Start Failure</p>
  </blockquote>
  <p>I created the application with Visual Studio 2017 (9) using .NET Core 2.2 although I installed .NET Core 2.2.3 on the server.</p>
  <p>On the server:</p>
  <pre><code>dotnet --info
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>.NET Core SDK (reflecting any global.json):
  
   Version:   2.2.105
   Commit:    7cecb35b92
  
  Runtime Environment:
   OS Name:     Windows
   OS Version:  10.0.14393
   OS Platform: Windows
   RID:         win10-x64
   Base Path:   C:\Program Files\dotnet\sdk\2.2.105\
  
  Host (useful for support):
    Version: 2.2.3
    Commit:  6b8ad509b6
  
  .NET Core SDKs installed:
    2.1.4 [C:\Program Files\dotnet\sdk]
    2.2.105 [C:\Program Files\dotnet\sdk]
  
  .NET Core runtimes installed:
    Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  
  To install additional .NET Core runtimes or SDKs:
    https://aka.ms/dotnet-download
  </code></pre>
  <p>Windows Application Event Log shows:</p>
  <blockquote>
  <p>Application '/LM/W3SVC/3/ROOT' with physical root 'C:\inetpub\wwwroot\healthmonitormvc' failed to load clr and managed application. Unexpected exception: HRESULT 0x800700b7 returned at c:\b\w\da744fbcc13abce\src\servers\iis\aspnetcoremodulev2\inprocessrequesthandler\inprocessapplication.cpp:198</p>
  </blockquote>
  <p>There are a couple of threads on GitHub concerning this error and hresult, but no resolutions.</p>
  <p>The same code works on a local IIS. <em>myapp.exe</em> also loads (as does <code>dotnet myapp.dll</code>), so it seems to be an IIS configuration issue (or .NET Core defect as indicated on GitHub which implies that I may be seeking a work-around). A <em>stdout</em> file is created, but it doesn't have any contents.</p>
  <p>This project is part of a solution with non-core projects. However, I published the project using Visual Studio web publisher and it runs as expected.</p>
  <p>One Stack Overflow question recommended changing to OutOfProcess as the hosting model, but I <em><strong>do not want to use out of process</strong></em>. It also fails to load with the same hresult. It may be the case that .NET 2.2.3 is broken in a major way. But since I can run it locally, there exists a configuration which works.</p>
  <p>This is the <em>web.config</em> file for the application:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;location path=&quot;.&quot; inheritInChildApplications=&quot;false&quot;&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath=&quot;.\my.name.space.HealthMonitor.Mvc.exe&quot; arguments=&quot;exec &amp;quot;.\my.anme.space.HealthMonitor.Mvc.dll&amp;quot;&quot; stdoutLogEnabled=&quot;true&quot; stdoutLogFile=&quot;.\logs\stdout&quot; hostingModel=&quot;InProcess&quot;&gt;
          &lt;environmentVariables&gt;
            &lt;environmentVariable name=&quot;ASPNETCORE_ENVIRONMENT&quot; value=&quot;Development&quot; /&gt;
          &lt;/environmentVariables&gt;
        &lt;/aspNetCore&gt;
        &lt;/system.webServer&gt;
    &lt;/location&gt;
      &lt;system.web&gt;
          &lt;compilation targetFramework=&quot;netcoreapp2.2&quot; /&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>I expect the page to load as it does in <a href="https://en.wikipedia.org/wiki/Internet_Information_Services#IIS_Express" rel="nofollow noreferrer">IIS Express</a> or IIS local in which the default out-of-the-box page is displayed.</p>