Servers - IIS - Troubleshoot

In this article

App startup errors

403.14 Forbidden

500 Internal Server Error

500.0 In-Process Handler Load Failure

500.30 In-Process Startup Failure

500.31 ANCM Failed to Find Native Dependencies

500.32 ANCM Failed to Load dll

500.33 ANCM Request Handler Load Failure

500.34 ANCM Mixed Hosting Models Not Supported

500.35 ANCM Multiple In-Process Applications in same Process

500.36 ANCM Out-Of-Process Handler Load Failure

500.37 ANCM Failed to Start Within Startup Time Limit

500.38 ANCM Application DLL Not Found

502.5 Process Failure

Failed to start application (ErrorCode '0x800700c1')

Failed to start application (ErrorCode '0x800701b1')

sc.exe start null

Connection reset

Default startup limits

Troubleshoot on Azure App Service

Important ASP.NET Core preview releases with Azure App Service ASP.NET Core preview releases aren't deployed to Azure App Service by default. To host an app that uses an ASP.NET Core preview release, see Deploy ASP.NET Core preview release to Azure App Service.

Azure App Services Log stream

App Service Logs!

enable logging!

Monitoring Log stream!

app logs!

Application Event Log (Azure App Service)

Run the app in the Kudu console

Test a 32-bit (x86) app

dotnet .\{ASSEMBLY NAME}.dll
{ASSEMBLY NAME}.exe

Test a 64-bit (x64) app

cd D:\Program Files\dotnet Run the app: dotnet \home\site\wwwroot\{ASSEMBLY NAME}.dll

cd D:\home\site\wwwroot Run the app: {ASSEMBLY NAME}.exe

ASP.NET Core Module stdout log (Azure App Service)

Warning Failure to disable the stdout log can lead to app or server failure. There's no limit on log file size or the number of log files created. Only use stdout logging to troubleshoot app startup problems. For general logging in an ASP.NET Core app after startup, use a logging library that limits log file size and rotates logs. For more information, see third-party logging providers.

ASP.NET Core Module debug log (Azure App Service)

Open Advanced Tools in the Development Tools area. Select the Go→ button. The Kudu console opens in a new browser tab or window. Using the navigation bar at the top of the page, open Debug console and select CMD. Open the folders to the path site > wwwroot. Edit the web.config file by selecting the pencil button. Add the section as shown in Enhanced diagnostic logs. Select the Save button.

 - Open Advanced Tools in the ```Development``` Tools area. Select the Go→ button. The Kudu console opens in a new browser tab or window.

 - Using the navigation bar at the top of the page, open Debug console and select CMD.

 - Open the folders to the path site > wwwroot. Edit the web.config file by selecting the pencil button. Add the <handlerSettings> section as shown in Enhanced diagnostic logs. Select the Save button.

Warning Failure to disable the debug log can lead to app or server failure. There's no limit on log file size. Only use debug logging to troubleshoot app startup problems. For general logging in an ASP.NET Core app after startup, use a logging library that limits log file size and rotates logs. For more information, see third-party logging providers.

Slow or hanging app (Azure App Service)

Monitoring blades

Warning Failure to disable the stdout log can lead to app or server failure. There's no limit on log file size or the number of log files created. For routine logging in an ASP.NET Core app, use a logging library that limits log file size and rotates logs. For more information, see third-party logging providers.

Troubleshoot on IIS

Application Event Log (IIS)

Run the app at a command prompt

Framework-dependent deployment

Self-contained deployment

ASP.NET Core Module stdout log (IIS)

Warning Failure to disable the stdout log can lead to app or server failure. There's no limit on log file size or the number of log files created. For routine logging in an ASP.NET Core app, use a logging library that limits log file size and rotates logs. For more information, see third-party logging providers.

ASP.NET Core Module debug log (IIS)

<aspNetCore ...>
  <handlerSettings>
    <handlerSetting name="debugLevel" value="file" />
    <handlerSetting name="debugFile" value="c:\temp\ancm.log" />
  </handlerSettings>
</aspNetCore>

Enable the Developer Exception Page

<aspNetCore processPath="dotnet"
      arguments=".\MyApp.dll"
      stdoutLogEnabled="false"
      stdoutLogFile=".\logs\stdout"
      hostingModel="InProcess">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
  </environmentVariables>
</aspNetCore>

Obtain data from an app

Slow or hanging app (IIS)

App crashes or encounters an exception

.\EnableDumps w3wp.exe c:\dumps
.\EnableDumps dotnet.exe c:\dumps
.\DisableDumps w3wp.exe
.\DisableDumps dotnet.exe

Warning Crash dumps might take up a large amount of disk space (up to several gigabytes each).

App hangs, fails during startup, or runs normally

Analyze the dump

Clear package caches

Additional resources

Azure documentation

Visual Studio documentation

Visual Studio Code documentation

Ref: Troubleshoot ASP.NET Core on Azure App Service and IIS