question

DebayanMitra-8526 avatar image
0 Votes"
DebayanMitra-8526 asked JoeHernandez-8911 published

Visual Studio 2019 - Breakpoint will not hit and showing source code different from entirely different project - .Net Core

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.


not-supported
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I came across this issue today as well, and was also at my wits' end. I had recently moved my projects into a /src subfolder and that may have been the cause of the spontaneous issue. What solved it for me was deleting the .vs folder that's at the same level as the solution file.

0 Votes 0 ·

1 Answer

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered DebayanMitra-8526 commented

Hi DebayanMitra,

Thank you for your feedback and taking the time to reach out to us.

According to this error, maybe you could refer to this similar thread, and check if your IIS was configured to use another project. Or you could run cmd in administrator mode, and run this command: iisreset to reset your IIS.

In addition, please check if there are some modifications you missed in project properties.

Note: please make sure if the "App URL" contains an application name.
30718-screenshot-2020-10-08-144509.jpg


If it doesn't work, since VS calls IIS express or IIS to debug mvc application, we also suggest you could post this question in IIS forum, the community members would provide better support about it.

Best Regards,
Dylan



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Dylan. I check the project debug properties and all the projects are configured correctly. Also this solution is in my local and I am running on IISExpress. Ideally even if files got modified accidentally, the 6 steps I performed should have cleaned and generated a correct version of pdb.

I will reach out to the IIS forums and see if I can get some help. Thanks again.

0 Votes 0 ·