Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging NET Framework source code not available

I am having trouble setting up Microsoft .NET Framework source code debugging for both Visual Studio 2008 and 2010 on Windows 7 x64 (I am having similar trouble on Vista x86 too).

I have followed instructions from this blog post as well as some other resource but without much success. I have also downloaded and installed all symbols from Microsoft Reference Source Code Center and followed their instructions also with no success.

It seems as if Visual Studio keeps loading PDBs without source code in them. It also keeps downloading PDBs even though a proper local cache exists.

This seems like a straightforward thing to do but I must keep repeating some errors in the setup procedure.

like image 281
wpfwannabe Avatar asked Sep 13 '10 18:09

wpfwannabe


2 Answers

It is the blackest of black arts to get that going, I futzed for a long time to get the 3.5 reference source going. Never got 4.0 figured out yet.

One problem I discovered is the symbol cache. If you've been debugging with the symbol server enabled before trying to get the reference source going then it it is filled with the wrong .pdb files, the ones that don't have source info. I fixed that by copying the .pdbs from the reference source (downloaded with the Massdownloader) by hand into the symbol cache directory, overwriting the bad ones. Pay dirt.

like image 110
Hans Passant Avatar answered Oct 12 '22 23:10

Hans Passant


Ok from what I can tell the following could be the reasons for why you don't get access etc.

Make sure you have .NET 4.0 as your target build when using Windows 7 + x64 + VS2010. The .NET 3.5 won't work, as it has to do with Microsoft not releasing the source for these symbols via the Public Symbol Source Service. You can get the 3.5 Sp1 etc at http://referencesource.microsoft.com/netframework.aspx

I'm not sure why you also have to specify your builds as x64 and not Any CPU or x86 in order to get this work, but yet, there ya go it's the case at the moment (for this specific scenario). If I try use either of these two I get zero access to source (Symbols Load normally but no access).

Hope that helps? this took me a day and a half of mucking around trying to figure out why so its not a lot but it works.

like image 2
Scott Barnes Avatar answered Oct 13 '22 00:10

Scott Barnes