1

I have a project in visual studio (c#) which is using .net 4.5, I arrived at a point where I need to debug the framework source to understand what's happening in a multithread deadlock.

I found http://referencesource.microsoft.com/netframework.aspx, where you can download the debug symbols, and I saw that there is a .net 4.5 update 1. Ok so I search on microsoft.com the update, install it, restart the pc, then install said debug symbols and configure visual studio for using them.

Problem: when I debug my project and try loading the symbols (like mscorlib), visual studio says that there are no matching symbols in the folder.
I saw this: How do you enable "Enable .NET Framework source stepping"?, in which it is said to disinstall the windows updates, but I have only installed KB2707250 (VS2012 update 1), KB2504637 (alters System.Net assembly), and KB2750149 (the .net 4.5 update 1) -- there are not other updates.
So the assemblies reported versions are v4.0.30319.18033 and v4.0.30319.17929, which from what I understand are v4.5 and v4.5 update 1 where it applies.

Fact is, I downloaded from referencesource.microsoft.com both debug symbols for .net 4.5 and .net 4.5 update 1, which, considering there are not any relevant updates on my system, should correspond to the installed frameworks.
But evidently it's so only for 5 of 18 referenced assemblies (project excluded).

How can I gather additional informations?
How can I make visual studio and the debug symbols work happily together?

In the end I can see the source, that's not complicated, but I don't know what values there are in fields and properties...

UPDATE:
I've been able to obtain the correct pdb ({3303BFEA-79E7-40C2-A2A8-34C1C816E082}), but still it lacks the source, so it's useless. Srctool doesn't seem to be useful either in this case.

Now the funny thing is: I have the source, AND I have the pdb, but it doesn't seem they can be used together. Don't know, maybe I'll think about recompiling mscorlib, if it's possible. ->No, apparently the answer is no.

Community
  • 1
  • 1
lunadir
  • 339
  • 3
  • 15
  • Other things that come to my mind: is there a checked/debug version of the .net framework? Would installing TFS help? (I read something about a symbol server, did not investigate further) – lunadir Mar 16 '13 at 20:52
  • The question is why do you need the .NET symbols and source code for troubleshooting a deadlock inside Visual Studio? WinDbg is more efficient in this case, http://msdn.microsoft.com/en-us/library/ee817661.aspx – Lex Li Mar 17 '13 at 02:05
  • If I'll have to, I'll try with windbg, but I'd prefer other ways first. I think I know where the the deadlock occurs, I don't know 100% when, since I don't know what object that thread is waiting for. As of now, I'm copying the methods that hang themselves in the project so that I can debug them. Considering I have to copy internal methods, I don't know if it will succeed. Anyway that's not the only possibility I thought of, but probably it's the simplest (apart from having the full pdb of mscorlib.dll). – lunadir Mar 17 '13 at 12:53
  • The art of dump analysis with WinDbg is that you can snapshot the process when deadlock occurs, and then analyze why it hangs. In that case, it is more obvious to know what object the thread is waiting for. That's a completely different troubleshooting approach, and very efficient for crash and hang issues. I could hardly see what benefits "copying methods" can bring. – Lex Li Mar 17 '13 at 13:15
  • You can load dumps with visual studio too, from what I know, but that's beyond the point. I know how to cause the deadlock with sufficient reproducibility, and with visual studio I can inspect the source and easily get the names of fields/methods and all the reflection. Sure, it misses some of the functions in the call stack, but I only barely used windbg, and if I remember well I have not been able to load the SOS dll for managed debugging. – lunadir Mar 17 '13 at 22:46

0 Answers0