简体   繁体   中英

VisualStudio 2017 - Debugger skips over code when using step into

What could cause VS 2017's debugger to skip stepping in to code? I've verified that the build is set to Debug and that the project's Properties->Build->Optimize code is unchecked. I've tried deleting all the source and output files from my computer and checked it out again from TFS, yet the issue still remains. I've tried logging in as a different account and uninstalling/reinstalling VS and neither resolved the issue. The debugger works fine if I set manual breakpoints and will hit them in portions it would otherwise not step into, but using Step into will often skip portions of my own code for no discernible reason.

Edit

So disabling Just My Code fixed it which I dont understand at all the code is in the same solution, although in two projects/assemblies. So I guess my answer would now be, why does VisualStudio think the middle/end of a method is not "My Code"

why does VisualStudio think the middle/end of a method is not "My Code"

According to msdn document:

Enable Just My Code

The debugger displays and steps into user code ("My Code") only, ignoring system code and other code that is optimized or that does not have debugging symbols .

Even if all the code is in the same solution, although in two projects/assemblies, you still need make sure if it is optimized and have debugging symbols.

Note : Don't miss copy .PDB file to the compiling directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM