views:

4873

answers:

5

I have a Visual Studio solution with four c# projects in it. I want to step into the code of a supporting project in the solution from my main project, but when I use the "Step into" key, it just skips over the call into that other project. I've set breakpoints in the supporting project, and they're ignored, and I can't for the life of me get it to step into any references to that project.

Everything is set to compile as "Debug", and I've seen VS warn me that my breakpoints won't be hit before - it doesn't do that in this case. It's as though it looks as though my code will debug, but then at run-time, there's a setting somewhere that tells VS not to step through the code in that project. All the other projects in my solutions debug without problems.

Please help me figure out what box I checked to cause this behavior!

UPDATE FOR CLARITY: The "Just my code" option is currently disabled. Also, since the code belongs to a project in my same solution, I don't think the "Just my code" option applies here. I thought that only applied to pre-compiled code that I didn't have the source for, but since I have the source in my project, I don't think this option has any effect.

+2  A: 

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.)

Brian
+2  A: 

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

SaaS Developer
+1  A: 

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.

Jason Down
+1  A: 

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.

Neil Whitaker
+5  A: 

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...

rwmnau
Oh my god this problem cost me a morning. Thanks for this.
mmr