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

后端 未结 12 1539
终归单人心
终归单人心 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:01

    WAG here, but I'd say you've referenced another project in your solution by BROWSING to a dll (project/bin/debug/mydll.dll) rather than by adding a "Project Reference." If you have multiple projects in your solution, remove ALL references to each project. Then, in the Add Reference dialog, hit the "add project reference" tab and select the project you wish to reference.

    Project references are always updated on a new build. But if you, say, browse to bin/release and add a reference to a dll in that directory, when you switch to debug mode and add code and try to debug it, the old release version of the dll is loaded into the appdomain and VS won't be able to hit any breakpoints (you'll notice the breakpoints are empty circles and the tooltip will say something about the code not being loaded).

    0 讨论(0)
  • 2020-12-15 17:01

    My problem was simple. I have multiple projects in the solution and I just need to set the project I am working with as Set As Startup Project.

    0 讨论(0)
  • 2020-12-15 17:06

    I have just found another reason for the problem, and a fix. I am creating a Windows Forms application using C++ in Visual Studio 2010. I am using the FreeType library and some code which depends on it and for various reasons this code has to be compiled with 'No Common Language Runtime Support' selected (Properties -> Configuration Properties -> General). I was not able to get breakpoints to be hit in this non-CLR code.

    The fix is that the main app must be compiled with 'Common Language Runtime Support (/clr)', NOT 'Pure MSIL Common Language Runtime Support) (/clr:pure)'. That immediately solved the problem. I can now debug into, and hit breakpoints in, the non-CLR code, including the FreeType C code.

    0 讨论(0)
  • 2020-12-15 17:07

    I've found the solution of the problem and it is really simple:

    In my solution's build configuration, the "Build" check-box of the project where the methods are, that get over-stepped, was not checked. I checked it, and now everything works.

    0 讨论(0)
  • 2020-12-15 17:10

    Try disabling "Require source file to be exactly matched" option in tools->options->debugging->general.

    0 讨论(0)
  • 2020-12-15 17:15

    My solution was to create a new project and load all my .vb files into the new project. Solved all of my issues.

    0 讨论(0)
提交回复
热议问题