问题
We have an asp.net core 2.0 project (migrated from 1.x) running on Vs2017.3 (updated from 2017.2).
After the update, breakpoints stop being hit. Vs reports that "The breakpoint will not currently be hit. The source code is different from the original version".
Things were normal before updating and migration. The problem can be seen after updating to 2017.3 and before migrating to asp.net core 2.0.
I know about the workaround: To right-click and force the breakpoint to be hit even when the source codes are different. I need a solution.
Clean-rebuild has no effect. The problem occurs on multiple computers.
回答1:
Try to clear/delete all breakpoints from the Debug menu, choose Delete All Breakpoints.
Note: The reason is that it refreshes your Visual Studio setting file of your project.
回答2:
Please check if there is Release Mode set in solution configuration. For break points it should be in Debug Mode.
回答3:
I lost 30 minutes reading and trying solutions. My case was completely different and the solution was very easy. I just had to change the project to Debug. I do not know how the value changed to Release. With VS2017, right click on the solusion then / properties / Configuration properties / Configuration, change the projects to Debug.
回答4:
For me I needed to untick "Require source files to match original versions ..." in Options, Debugging.
回答5:
Another solution that worked for me and was not listed here was the following:
- Open the modules window via Debug > Windows > Modules (or press Ctrl + Alt + U)
- Look for your project and check the status (probably says 'Not Loaded')
- Right click the project and click load symbols, from here you will have to specify the location of the .pdb file from which to load the symbols.
Boom! You should be able to set breakpoints once again!
来源:https://stackoverflow.com/questions/45769573/after-updating-to-vs2017-3-the-breakpoints-will-not-be-hit