Debugging ASP.NET Core applications running in IIS

  1. Publish web application with Debug configuration
  2. Set up web site on IIS as described here
  3. Open web site in browser to have dotnet process started
  4. In Visual Studio open Debug -> Attach to Process or press Ctrl+Alt+P
  5. Make sure in “Attach to” line you have “Automatic” or “Managed (v4.6, v4.5, v4.0)”. If not, press select and choose “Automatically determine the type of code to debug”
  6. Check “Show processes from all users”
  7. Select dotnet.exe and press Attach

Note: If you see several dnx.exe processes, choose the one with IIS user in column username. By default it is “IIS APPPOOL{your app pool name}”

P.S. If you see dotnet process with empty username, run Visual studio as Administrator

UPDATE

With ASP.Net Core 1.0.0 you must attach to “{youprojectnamet.exe}”. E.g. if you project has name “Web”, you must attach to “Web.exe”
Also you can find name of the executive in the following section of web.config

<system.webServer>
   <aspNetCore processPath=".\Web.exe" />
</system.webServer>

Leave a Comment