Debugging doesn't work in ASP.NET Core or VS2017 at all
I am working on a project and I have two servers, a login server and an additional server that serves the application. The secondary server is ASP.NET Core, but the first is just ASP.NET MVC because I couldn't get Identity to work with tokens for Angular2, in Core. In VS2015, breakpoints worked for MVC, but not for Core. I moved in 2017 hoping it would fix things. There are no breakpoints, although my A2 project is running, the methods are being called. The debugger says there is no debug information for the code. I went to the project settings and told it to generate a full pdb (at the bottom of the build settings, under "advanced"), I disabled "just my code" and enabled .NET code breaks. These are all the suggestions I can find on the internet. My checkpoints are still missing.
source to share
When trying to debug a .NET Core web app, make sure you are connected to the correct process. I have w3wp.exe
the same problem as the OP described when I was connected to a process w3wp.exe
.
When I connected to the processdotnet.exe
I was able to break as expected.
FYI, this was in .NET Core 2.0 web application.
The following link is about remote debugging with .NET Core, but parts of it remain applicable.
Remote debug ASP.NET core on a remote IIS machine in Visual Studio 2017
A short excerpt from the link:
Enter the first letter of the process name to quickly find dotnet.exe (for ASP.NET Core). Note. For an ASP.NET Core app, the previous process name was dnx.exe.
Click Attach.
source to share
OK, it looks like I got a web.config file from somewhere like:
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
Not sure how it happened, but if I comment on this, debugging work ...
source to share
What worked for me was the following (VS2017):
- Open project properties
- Open build tab
- Click on Advanced ...
- Set Debug Info to FULL
- Clean up and restore
source to share