- Publish web application with Debug configuration
- Set up web site on IIS as described here
- Open web site in browser to have dotnet process started
- In Visual Studio open Debug -> Attach to Process or press Ctrl+Alt+P
- 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"
- Check "Show processes from all users"
- 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>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…