12

I really have a problem, I have a VS 2010 solution and it suddenly stopped debugging for referenced projects, I just can debug the start up project but not the added as reference. This is weird because I created a new solution, added two projects and then I debugged in both successfully, did that in order to see if my VS config was wrong, but nop, It's something on this particular solution that is not allowing me to debug referenced projects.

I've read all possible solutions from this forum and other sources like Microsoft. If I go to menu Debug -> windows -> Modules the ones I want to debug are not in the list. screen 1 my running modules

so, I read a Microsoft's page saying how to manually load symbols, I did the following:

To specify a directory where symbol files are located

On the Tools menu, choose Options.

In the Options dialog box, open the Debugging node and then click Symbols.

On the Symbols page, there is a box that states Symbol file (.pdb) locations. Above the box are four icons.

Click the folder icon.

Editable text appears in the Symbol file (.pdb) locations box.

Type the directory path. Statement completion helps you find the correct format.

If you are doing remote debugging, symbol files and symbol server caches for managed code must be located on the remote computer. Symbol files and symbol server caches for native code must be located on the local computer.

If you are using symbols on a remote symbol server, you can improve performance by specifying a local directory that symbols can be copied to. To do this, type a path in the Cache symbols in this directory box. If you are debugging a program on a remote computer, the cache directory refers to the directory on the remote computer.

Click OK.

That didn't work, I still can't see the modules I want to load so.. any ideas my friends ?

1
  • 4
    Please don't use JPEG screenshots. Commented Oct 12, 2011 at 1:13

19 Answers 19

9

One more thing to check, just to be clear: Make sure you have the configuration set to 'Debug' and not 'Release'. You can debug the startup project in 'Release' mode, but not a referenced class library.

Sign up to request clarification or add additional context in comments.

Comments

6

The holy trinity in such cases: rebuild all, restart VS, restart computer.

  • Rebuild all: making sure that everything is up-to-date. If it doesn't work:
  • Restart studio: in some cases, the debug symbol service gets stuck a won't refresh the loaded symbols with the newly compiled ones. In most of the cases restarting the VS will solve the problem. If not:
  • Restart computer: brute force but effective.

Also, you should check if you're build emitting a debugable assembly.

2 Comments

You forgot Clean, and removing all temp files. Lol
Try to FIX instead of patching!
5

I solved this like follows:

  • Go to Project Property Page.
  • On left hand side go to the Build tab.
  • Search/Scroll down to for "Generate serialization assembly".
  • In front of this text there is "Advanced..." button: click it.
  • Make sure that you have Debug Info as full.
  • Click ok and you are done.

Comments

2

This usually means that the assembly you're trying to debug is out of date (Your source is not the same as the one used to create the assembly). One of the problems I see a lot, is if the solution didn't build due to errors, but you didn't notice and end up debugging the last successful build. Make sure all projects are rebuilt, and successful.

Comments

1

Might be that the solution configuration has gone haywire. Make sure that your using debug and that debug info is checked for the configuration

Comments

1

I solved, the answer might not be good I pretty sure but to tell the truth I had to uninstall and reinstall the application. Worked like a charm. I know, that takes a lot of time but I already spent time trying to solve the issue so ...

Comments

1

The idea of stopping and restarting VS 2010 worked for me for the same problem. However, I had to open a different and unrelated solution, close that one and reopen the solution with the debug symbols problem. All is now well. Hope this helps.

Comments

0

So I fixed it, I know is not the best solution but it worked. Since it was extremely weird this behavior, I had to create a new solution from scratch, then created all my projects/layers, and then manually copied all classes one by one making sure I can debug each project.

Just like that, It took me like 1.5 hours but I finally did it. I know, I know, this doesn't sounds like a solution at all but it worked for me...

Comments

0

Having the same problem I was able to fix it by 1. Check everything into source control. 2. Delete all local files 3. Get everything from source control.

This fix the problem and the solution seems to build faster now as well.

Comments

0

If you are opening code that was created by another user (e.g. teacher), make sure that the script in the .htm file matches the .js filename i.e. src="scripts/Objects.js" if your project/file name is Objects.js

Comments

0

I just ran into this issue.

In order to fix it, I did:

Build -> Clean
Build -> Build <Project Name>

Then I began debugging the project and the symbols loaded correctly.

Comments

0

I had a similar issue where i used a configtransform in a web project. Even though i set my configtransform to not remove the compilation debug=true, and enabled define DEBUG constant, i was not able to make it generate the debug symbols when in a certain compilation mode.

It turned out that there is some properties defining whether to generate debug symbols in the csproj file. Unload the project and find the PropertyGroup element matching the compilationmode.

Then make sure you have the following properties inside the PropertyGroup

<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>

And if it's a website you want to publish using web deploy, i belive you also need the following property set.

<ExcludeGeneratedDebugSymbol>false</ExcludeGeneratedDebugSymbol>

Comments

0

I've got this behavior in VS2012 because in Tools -> Options -> Debugging -> General, the "Managed C++ Compatibility Mode" was turned on. The Project is mixed C# / C++ com interop.

Comments

0

Had the same problem today, tried everything suggested here but nothing worked. My module was not appearing in Debug->Modules window no matter what.

However, after giving up I found something interesting: while navigating throughout the application, some modules started to load 'on the fly' in the Modules window. I assume the code reached sections that needed those modules and Visual Studio was being smart and loaded them.

I believe this is some sort of optimization from Visual Studio to load modules on demand. Kind of intelligent actually, it's just that it took me some frustrating time to discover it. For this reason, if you look at the Debug->Modules when starting the debugger some of the dependent assemblies won't be loaded - even if you are 100% certain that dependency exists.

Hope this helped others in my situation.

Comments

0

Perhaps this'll help someome ...

Today I returned to a solution started weeks ago containing a web service and a test application. It turns out I had published the web service to another server (which is something I'd forgotten but VS had not-so-helpfully remembered) meaning that when started the test app ran in debug but it was making calls to the remote web service.

The fix ...

  1. Expand Service References in the test application project

  2. Right-click on the web service reference and select "Configure Service Reference"

  3. In the Client area, point the Address to the localhost eg :

    http://localhost:51746/MyWebService.asmx
    

Comments

0

A bit late here but I just Googled a similar issue and I came straight here. I'm using VS2010(c++) and had a similar issue with a bug only seen in a Release build. My fix to get the symbols loaded was to ask VS2010 to create and load them :-)

SolutionExplorer->ProjectName - Right click and select Properties. In the property page, at the top, confirm the correct configuration and platform that you are about to change the properties, for me I wanted Release and x64. Open up the Linker->Debugging, in the properties pane there is an option to 'Generate Debug Info' - change this to 'Yes'. Rebuild and the debug symbols are generated and loaded for debugging. You can selectively do this for each project in the solution.

Hope it helps.

[EDIT] Be aware that due to optimisations and possible assembly code re-ordering that the values that not make sense in some situations.[/EDIT]

Comments

0

I had this issue. I tried everything, rebuild all, restarting VS, restarting machine, etc. I finally figured it out, and the issue is extremely annoying. The debug dropdown, which contains "Debug", "Release" showed "Debug" the entire time I troubleshooted this issue. However, it appears that it was attempting in release. With it already set to Debug, I opened the dropdown menu, selected Debug, and then started again and symbols were loaded successfully. And again, this is after attempting to restart computer and everything. And visual studio loads with the dropdown defaulted to "Debug" yet I have to select it from the dropdown anyway. :@

Comments

0

I just had this issue with VS2013.

The project would build, but no symbol file would be shown in the modules panel.

I ended copying the source code to another folder, then rolled back the project to a previous version via git, then copying over the source code only (no project, bin, obj, etc).

Then cleaned and rebuilt and Viola, the symbols are back and i haven't lost any code.

It must have corrupted the project file or something.

Comments

0

In my case I had 2 projects in the solution, a NET Web App and a Class Library (to be referenced by Web App).

The Problem: In both projects (Project > Properties > Application), I had the same value for Assembly Name. I think this was causing a conflict in loading the PDB for the dependency (the Class Library project).

Solution: Change name of Assembly in the Web App, clean and rebuild.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.