Last post Oct 07, 2020 05:57 PM by mgebhard
Oct 07, 2020 04:16 AM|debayan002|LINK
I am working on a Microservice based solution where in my same VS 2019 solution I have multiple microservice APIs, one API Gateway and two ASP.NET MVC presentation layer
project. Everything was fine, till one day one of the presentation layer project's Startup.cs debug breakpoint will not hit.
On hovering it shows, "The breakpoint will currently not hit. A copy of Startup.cs was found in <AnotherASP.NETMVCProject.dll>, but the current source code is different from the version built into <AnotherASP.NETMVCProject.dll>".
Now the another MVC presentation project that I have, debugging works fine in its startup. Its weird why one MVC project debugging will not work stating source code is different in another MVC project. Also no source code modifications are done.
Tried the following. Got no luck:
1. Clean entire solution, rebuild
2. Delete breakpoints, clean and rebuild and then add breakpoints and run
3. Restarted machine, clean, rebuild
4. Deleted manually all Bin folder contents and clean again and rebuild
5. Closed VS, deleted ASP.NET temporary files and then restarted VS, clean and build
I am at wit's end as to why this would happen all of a sudden. This seems like a VS 2019 bug. But any solution or workaround will help.
Oct 07, 2020 05:23 AM|DA924|LINK
The breakpoint will not be hit until the source code the Visual Stuido project is using and the assembly/binary for the project deployed to the Web server are in sync. It's a clear indication that the source code for the project VS is using and the assembly/binary
for the project on the Web server are out of sync if the breakpoint icon on a code line in Visual Stuido that has been set is not a solid breakpoint icon.
Oct 07, 2020 07:22 AM|debayan002|LINK
But how is it out of sync without making any changes? It started to popup suddenly. Also the debugger is not getting hit on MVC Project A and hovering over it shows source code out of sync in MVC Project B. Why would Project A debugger not hit (even if Project
B source code is out of sync. And Project B debugger works just fine)
Also all the code is in my local running in IISExpress. So what is the workaround to this apart from the steps that I tried?
Oct 07, 2020 04:58 PM|DA924|LINK
You could stop using IISExpress and push the solution out to local IIS on your machine and see if the problem follows.
Oct 07, 2020 05:57 PM|mgebhard|LINK
But how is it out of sync without making any changes? It started to popup suddenly. Also the debugger is not getting hit on MVC Project A and hovering over it shows source code out of sync in MVC Project B.
This symptom typically indicates a project pdb (debug) file is out of sync with the dll. The pdb file contains debugging symbols the debugger uses to create the debugger UI, single step, etc. pdb files are created in debug configuration not release. You
should be ale to fix this issue by building all projects in debug mode. Make sure the project you're debuging has the correct pdb files.
Also make sure the solution is in debug mode not release when starting the debugger.