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.

+6


source to share


6 answers


It might help someone.

When you debug a release, the breakpoints will not be removed.



Make sure you select debug when you hit f5 or run.

+17


source


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.

+6


source


  • Exit Visual Studio
  • Right click on shortcut for Visual Studio
  • Select - Open File Location
  • Right click on the Visual Studio 2017 file, select Properties
  • Click Advanced.
  • Run as administrator -> X == On
  • Apply. OK. OK ... blah blah
+2


source


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 ...

0


source


What worked for me was the following (VS2017):

  1. Open project properties
  2. Open build tab
  3. Click on Advanced ...
  4. Set Debug Info to FULL
  5. Clean up and restore
0


source


Just change Solution Configs to Debug Mood

You can see it in the attached image enter image description here

0


source







All Articles