简体   繁体   中英

Visual Studio 2013 F10/F11 doesn't return to the place where function was called?

I have a problem with debugging in VS2013 C# code. So, while debugging (for example at level 0) to step into function (level 1) I press F11 . Then I press F10 to run through the function. Цhen I press F10 at the end of the function I'm waiting that I'll return to the place, where I pressed F11 .

But it doesn't work. If there is one more call of any function (at level 0) it will step into it, if not - there will be the same effect as if I press F5 . So now the only opportunity to step to the level 0 is to put there a breakpoint.

Also, pressing Shift + F11 does not work, too.

Is there any idea how to fix this?

I have seen such things a few times. It sometimes happend when your PDB/Symbols/sth get out of sync with your code, or if some parts of the code are native (or optimized!) and you switch between disassembly and managed code. Im my cases, when this happened, almost always it looked like the IDE weren't able to trace "not-yours-code" (ie optimized framework parts) properly and stepped-into the first possible unoptimized one.

Now, usually, clean&rebuild helped. However, not always. I remember that I was working once on some complex setup with multiple AppDomains and three worker processes, all of them under simultaneous debugging - cleaning did not help, something other did, but I don't remember what. It was weird case anyways.

However, all of that are really rare cases. I've seen them like 6 or 7 times in the last few years. Yes, that rare. Yes, that spans over multiple VS versions, too. The case where clean&rebuild did not help was single. Hence - try cleaning.

One last word - depending on how much your case and IDE installation is screwed up, 'Clean' sometimes does not really clean. If cleaning does ont help, 'clean' again and manually delete all bin and obj files.

It's all guessing and random thoughts, but maybe will help. Good luck!

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