4

I am trying to debug a visual studio 2010 addin using SOS. I attached windbg but there is no clr.dll. I tried .loadby sos mscoree, .loadby sos corjit, and none of them worked. I got kinda working by switching to x86 mode with !sw and copying sos to ide folder and running .loadby sos devenv. When I try to use any of the sos commands though I get the error below. Is there a way to use sos with visual studio? I want to just find out what exception is in this addin so I can report to team that wrote it.

Failed to find runtime DLL (clr.dll), 0x80004005 Extension commands need clr.dll in order to have something to do.

user1985513
  • 481
  • 1
  • 4
  • 13
  • 1
    What version of .NET are you using? Once you attach the .dmp file, use the `lm` command to see all the loaded modules. You should see either `clr` or `mscorwks` in the list. – Davin Tryon Jan 21 '13 at 23:14
  • 2
    For another approach, I seem to recall that you can run up another instance of VS itself and attach to the other one as a debugger. – 500 - Internal Server Error Jan 21 '13 at 23:15
  • I wish I could get working with having to use another visual studio instance. I just want to find out where the exception is being thrown really quick – user1985513 Jan 21 '13 at 23:17
  • I tried another vs instance. I can see clr.dll in module window here. but I am having problems breaking on the exception. !soe -Create System.NullReferenceException Error initialized register $t1 to zero sxe clr ; expected – user1985513 Jan 21 '13 at 23:25

3 Answers3

0

I want to just find out what exception is in this addin so I can report to team that wrote it.

I suggest you use AdPlus to capture a Memory Dump.

Before you capture the memory dump make sure you have set it up to take a Full Dump. (Right Click My Computer > Properties > Advanced Settings > Advanced > Startup and Recovery > Write Debugging Information)

The 3rd party vendor will need this to study the problem.

Unless you have their private PDB files you wont be able to uncover too much about the problem.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
  • 1
    _The 0x80004005 indicates Access Denied, double check you are running as Administrator_ -- this is not true. `0x80004005` is E_FAIL, which is generic unspecified error code. Access Denied is `0x80070005`. See [this MSDN page](http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137(v=vs.85).aspx) for reference. – seva titov Feb 01 '13 at 21:43
  • Using [Error Code Look-up tool](http://www.microsoft.com/en-us/download/details.aspx?id=985) you're correct. – Jeremy Thompson Feb 02 '13 at 02:23
0

Try loading sos manually. Example: .load C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll

jmcg
  • 357
  • 3
  • 12
0

I fixed this error by closing WinDbg, deleting all the files in my Symbols directory, then reloading WinDbg. Then, I loaded sos with ".loadby sos mscorwks" and commands like "!dumpheap" were working for me again.

Check the "File > Symbol File Path..." menu to find the path to your Symbols directory.

Josh
  • 2,142
  • 2
  • 23
  • 20