Visual Studio 2010 debugger steps over methods and doesn't stop at breakpoints

后端 未结 12 1573
终归单人心
终归单人心 2020-12-15 16:59

My Visual Studio 2010 debugger sometimes has a very strange behaviour...

Sometimes it doesn\'t stop at breakpoints, but when it stops, and I want to step into a meth

12条回答
  •  温柔的废话
    2020-12-15 17:26

    Here are a couple of reasons and workarounds for why Visual Studio will avoid stepping into a particular method.

    • Just My Code is enabled. In certain circumstances the "Just My Code" setting will prevent you from stepping into a method / property. To avoid this you can disable "Just My Code" in the debugger options page (Tools -> Options -> Debugger -> Uncheck "Just My Code")
    • Symbols are not loaded for the target method. If the target method is a part of another DLL it's possible that symbols are not loaded for that DLL and hence Visual Studio will not be able to step into it by default. To force the symbols to load, open up the Modules view (Debugger -> Windows -> Modules), navigate to the DLL containing the method, right click and load symbols.
    • The method is explicitly marked with a debugger attribute such as DebuggerNonUserCode which causes the debugger to step over the method.
    • The method is actually a property or operator and you have "Step Over Properties and Operators" setting enabled (this is the default). This can be disabled via the debugger options dialog.

提交回复
热议问题