Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
271 views
in Technique[技术] by (71.8m points)

ssl - Debugging ASP.NET Core applications running in IIS

Is there any way to debug an ASP.NET Core web application while running under IIS?

I'm running under IIS because I need it to be available over SSL on port 443.

question from:https://stackoverflow.com/questions/36296572/debugging-asp-net-core-applications-running-in-iis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...