Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging not working in ASP.NET Core, or in VS2017 at all

I am working on a project, and I have two servers, a login server, and a secondary server which serves the application.

The secondary server is ASP.NET Core, but the first one is just ASP.NET MVC, because I couldn't get Identity to work with tokens for Angular 2, in ASP.NET Core. In Visual Studio 2015, breakpoints worked for ASP.NET MVC, but not for ASP.NET Core.

I moved to Visual Studio 2017 in the hope it would fix things. No breakpoints are hit at all, although my A2 project works, the methods are being called.

The debugger says that there's no debug information for the code. I've gone in to project settings and told it to generate the full pdb (at the bottom of build settings, under 'advanced'), I've turned off 'just my code' and turned on .NET code breaks. These are all the suggestions I can find online. My breakpoints are still not being hit.

like image 863
cgraus Avatar asked Apr 01 '17 03:04

cgraus


People also ask

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How can I tell if debugging is enabled in asp net?

In the Web. config file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to true. Change the debug attribute to false to disable debugging for that application.

How do I debug in .NET core?

Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.


1 Answers

The following worked for me (Visual Studio 2017):

  1. Open the project properties
  2. Open the Build tab
  3. Click on Advanced...
  4. Set Debugging information to FULL
  5. Clean and rebuild
like image 153
Olavo Neto Avatar answered Oct 14 '22 03:10

Olavo Neto