title: .Net core Service Unavailable after Publish to IIS
body: <p>After I published my up to IIS when I try to access it I get the error:
  Service Unavailable</p>
  
  <blockquote>
    <p>HTTP Error 503. The service is unavailable.</p>
  </blockquote>
  
  <p>What should I do next?</p>
  
  <p>I use Windows Server 2008(64 - bit) with IIS 8.5. The app is web api .NET CORE 2.2.1.</p>
  
  <p>On the Windows machine I have installed:</p>
  
  <ul>
  <li>Microsoft .NET CORE 2.2.1 - Windows Server Hosting</li>
  <li>Microsoft .NET CORE Runtime - 2.2.1(x64)</li>
  <li>Microsoft .NET CORE Runtime - 2.2.1(x86)</li>
  <li>Microsoft Visual C++ 2015 Redistributable(x86) - 14.024212</li>
  <li>Microsoft Visual C++ 2015 Redistributable(x64) - 14.024123</li>
  <li>Microsoft Visual C++ 2008 Redistributable - x86 - 9.0.30729.4148</li>
  <li>Microsoft Visual C++ 2008 Redistributable - x64 - 9.0.30729.6161</li>
  </ul>
  
  <p>I made a publication from the visual studio. Into IIS on modules i have AspNetCoreModuleV2.</p>
  
  <p>The webconfig file I have: </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;location path="." inheritInChildApplications="false"&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath=".\App.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" /&gt;
     &lt;/system.webServer&gt;
   &lt;/location&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: 9d04b7be-318b-4e95-aae3-c47aab07db30--&gt;
  </code></pre>
  
  <p>Code from CreateWebHostBuilder Method:</p>
  
  <pre><code> return WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;().UseSerilog((ctx, cfg) =&gt;
              {
                  cfg.ReadFrom.Configuration(ctx.Configuration)
                      .MinimumLevel.Verbose()
                      .MinimumLevel.Override("Microsoft", LogEventLevel.Information);
              });
  </code></pre>