When I debug one .Net 4.0 program with SOS. After .loadby sos clr then run any SOS command results in following errors:
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 mscorwks.dll is in the version directory
3) or, if you are debugging a dump file, verify that the file mscordacwks_.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.
You can also run the debugger command .cordll to control the debugger's load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload. If that succeeds, the SOS command should work on retry.
If you are debugging a minidump, you need to make sure that your executable path is pointing to mscorwks.dll as well.
By google, some posts were found with same error info. But most of them are focus on the debugging dump on another machine with differnt mscordacwks version. This is not the case as I’m doing living debug. From the 1) hint of the error message I check the Windbg version is 6.6 and then install the newest version 6.13.0006. It works!
~~~~~~~
The same error happened during debug a Waston dump. The solution is
0:000> .cordll -ve -u -l
CLRDLL: Unable to find mscordacwks_AMD64_AMD64_2.0.50727.5005.dll by mscorwks search
CLRDLL: Unable to find 'mscordacwks_AMD64_AMD64_2.0.50727.5005.dll' on the path
CLRDLL: Unable to find mscorwks.dll by search
CLRDLL: ERROR: Unable to load DLL mscordacwks_AMD64_AMD64_2.0.50727.5005.dll, Win32 error 0n2
CLR DLL status: ERROR: Unable to load DLL mscordacwks_AMD64_AMD64_2.0.50727.5005.dll, Win32 error 0n2
The version we are trying to find is 2.0.50727.5005, while check the attribute of file mscordacwks.dll under D:\Windows\Microsoft.NET\Framework64\v2.0.50727 it turns out its version is 2.0.50727.4454. Copying the mscordacwks.dll from the machine where the dump was generated to the root path where Windbg is installed and rename it to mscordacwks_AMD64_AMD64_2.0.50727.5005.dll. It works!