1

I am working on Dotnet Core + Angular application with Visual Studio 2019. After publishing code in release mode and deployed on IIS. When I changed the code to debug and tried to debug something the breakpoints are not getting hit on any controller. Does anybody ever faced this problem, it would be helpful to have any solution on this. Here is my project properties

enter image description here

Virender Thakur
  • 421
  • 7
  • 23
  • Did you debug a net core 3.0 project and then debug some changed code under `xxx-controller.cs` files? – Mr Qian May 19 '20 at 03:01
  • Breakpoints are hitting in Startup.cs file whenever project started, but not when there is any requested URL from Angular to core. – Virender Thakur May 19 '20 at 08:14
  • Please try to enable `Javascript Debugging for Asp.Net` under `Tools`-->`Options`-->`Debugging`-->`General` and if you debug js code under cshtml file. You should put these js code into a single javascript file and then reference the js file in cshtml file. Refer to [this](https://stackoverflow.com/questions/61753928/howto-debug-javascript-inside-asp-net-core-3-1-mvc-applications-razor-view). And if these do not work, I think it is related to your project and please share s small sample with us to troubleshoot your issue. – Mr Qian May 20 '20 at 09:33

1 Answers1

1

Visual Studio 2019 break point is getting hit

This is indeed a very strange behavior and I suggest you could try these suggestions to troubleshoot your issue:

Suggestion

1) Right-click on your project-->Properties-->Build-->Advanced-->change Debugging Information to Full.

2) make sure that you use IIS Express with Google Chrome or change to use IE to debug your project

3) Tools --> Options-->Debugging-->Symbols--> select Microsoft Symbol Servers-->Click Load All Symbols

4) close VS Instance, delete .vs hidden folder under solution folder, bin , obj folder and then restart your project to test again.

Update 1

Based on your issue, JS sent request to Core and could not enter the breakpoint, you can try these steps:

1) enable option Javascript Debugging for Asp.Net(Chrome,Edge and IE) under Tools-->Options-->Debugging-->General

2) If you try to debug js on cshtml, you should move these js into a single javascript file and then reference such js file in cshtml. You can refer to this link.

Hope it could help you.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41
  • I have the same issue, suddenly. Clearing all DLLs rebuild, restarting, using your tips do not help. It is not breaking at Controllers anymore. – Egbert Nierop Aug 11 '20 at 21:18