2
votes

I'm trying to debug .NET 4 32-bit (explicitly set in project options) application with WinDbg on Windows 7 x64, here are the steps:

  • Start my application (let it be foo.exe)
  • Start x86 version on windbg.exe
  • Attach to foo.exe
  • .loadby sos clr
  • !dumpheap -stat

After that I get this:

Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
            2) the file mscordacwks.dll that matches your version of clr.dll is 
                in the version directory
            3) or, if you are debugging a dump file, verify that the file 
                mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
            4) you are debugging on the same architecture as the dump file.
                For example, an IA64 dump file must be debugged on an IA64
                machine.

What is wrong? I've searched a lot.. this question looks to be about memory dump: Failed to load data access DLL, 0x80004005 But I'm trying to debug a running application.

2
The question you link to is the same issue. See point 2. Did you install .NET 4.5 by any chance?leppie
Also, presume you do have windbg >= v6.2.14?Iridium

2 Answers

3
votes

The DAC is the layer that SOS uses to talk to the managed runtime. If the correct version cannot be located for some reason (or if your debugger is outdated), you'll see this message. If you do a .cordll -ve -u -l, you get more information about what version it is trying to load and you should be able to troubleshoot from there.

2
votes

Finally I've used Visual Studio Immediate Window instead of WinDbg to do call SOS functions (dumpheap and so on): http://msdn.microsoft.com/en-us/library/bb190764.aspx