'ASP.Net break point set but not firing in visual studio 2019

I've got a old asp.net project that I'm having trouble getting the breakpoints to hit when I open it in Visual Studio 2019.

It just seems to step over the breakpoints.

The project is set to Debug mode, I've also checked the output window and the symbols are being loaded.

If I add in the following line of the code

System.Diagnostics.Debugger.Break();

It will break, but if I remove the above line of code the break point on the next line does not get hit.

Has anyone else experienced behaviour like this and did you manage to solve the problem?



Solution 1:[1]

Has anyone else experienced behaviour like this and did you manage to solve the problem?

Please try these:

1) delete all breakpoints under Debug-->Delete all breakpoints

2) check Managed Compatibility Mode under Tools->Options->Debugging-->General

and check Enable .NET Framework source stepping under Tools->Options->Debugging->General

3) close VS Instance, delete .vs hidden folder,bin,obj folder under the path of your project and then restart your project.

4) Right-click on your project-->Properties-->Build-->choose Optimize Code.

In addition, if these do not work, Running the VS command prompt as admin and then runn devenv /setup.

Solution 2:[2]

in my case it was ridiculous, in the emulator the network data was off, turning it on solved the problem

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mr Qian
Solution 2 Behnam Abdy