Enable and disable “Step into” debugging on certain project in a Visual Studio solution

牧云@^-^@ 提交于 2019-11-30 11:02:06

One thing to check for is that your supporting project assembly has not been installed in the GAC. Open a command prompt and run the following to make sure...

gacutil /l assemblyName

Not sure if this is it, but "Tools>Options>Debugging>General:Enable Just My Code" is a possibility. (I prefer to always leave this unchecked.)

It turns out that the assembly needed to be copied into the GAC before it could be debugged. Under the debugging option "Just my code", there's an option to suppress an error if you don't have any user code, and it was suppressing the following error:

The Following mobile was built either with optimizations enabled or without debug information. (Module name and path) To debug this module, change its build configuration to Debug mode.

Since I was building it in Debug configuration, I searched on that error message and got this:

http://claytonj.wordpress.com/2008/01/04/the-following-module-was-built-either-with-optimizations-enabled-or-without-debug-information/

Problem solved. I don't know why it needs to be in the GAC in order for me to step into the project, but it does. I don't ask why, I just ask how, and then I do it...

You need to ensure the supporting projects have pdb files or else Visual Studio will not have the necessary information to step through the code.

A couple of possibilities:

  • There is a check box to step into "just my code". Its intent is to make it so you can't step into Microsoft's Framework code (unless you choose to by unchecking the box).

  • You might try recompiling the supporting code to make sure the code you're debugging exactly matches the code file you're looking at. VS does care about this and will disable a breakpoint if you put it in the code file whose version doesn't match. Also, make sure the PDB file is in the same directory as the DLL.

If you have the source code for the dll's into which you are trying to step into, do the following:

  1. Click on the project in which these dll's are added as reference and remove them.
  2. Add the Project(s) corresponding to the dll(s) to the solution
  3. Right click on the project -> Add Reference -> Choose the newly added Project(s).

Now set the break point and debug the code.. You will be able to step into the code.

The reason for the issue is because you program is still referencing the old dll (without the source code) as it has been added to your project as a reference. Once you remove that dll and add the Project (Source code of the dll) of the dll, Visual studio will be able to step into your code.

In Visual Studio 2013 one way to cause this behaviour is to set build configuration to Release.
Put it back to Debug and see if that helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!