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

42,820

Solution 1

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

Solution 2

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

Solution 3

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

Solution 4

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.

Solution 5

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.

Share:
42,820

Related videos on Youtube

eugened
Author by

eugened

My name is Ryan McCauley, and I'm a database/reporting manager for a mid-size cable company. I spent a number of years as a .NET developer (mostly of the VB.NET variety), but now largely focus on T-SQL and the reporting with the Microsoft BI stack. On my own time, I build small apps to help get things done a little better, and have a couple posted at Codeplex: SQL Space Map - if you have some large SQL Server databases and you'd like a visual picture of which tables and indexes are taking up that space, it's the tool for you. SQL Server Contention Monitor - watches as may SQL Servers as you want and alerts you to blocked SPIDs, showing you the block tree (which process is blocking which, an what others are affected). It's still in a pretty alpha-ish phase, but it despite some instability at times, it gets the job done. Check them out and let me know what feedback you have!

Updated on July 09, 2022

Comments

  • eugened
    eugened almost 2 years

    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 Visual Studio 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 Visual Studio not to step through the code in that project. All the other projects in my solutions debug without problems.

    What box have 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 it 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.

  • mmr
    mmr about 14 years
    Oh my god this problem cost me a morning. Thanks for this.
  • rank1
    rank1 almost 10 years
    THis is probably stupid quesion but how do You copy dll (or any file) into C:Windows/Assembly on Windows7? Drag & drop, copy & paste is not enabled for this particular directory
  • rank1
    rank1 almost 10 years
  • solujic
    solujic about 7 years
    I have the same problem described, also 4 projects in a solution but I have no idea what GAC is or how to solve this issue.
  • solujic
    solujic about 7 years
    Hmm this made my breakpints work any further explanation why?