我需要使用WinDbg调试32位托管应用程序,但WinDbg固执地拒绝加载SOS.dll扩展.经过许多互联网搜索和尝试的事情,我很难过.我有使用WinDbg调试非托管代码的经验,但这是我第一次尝试使用托管.
当我指示WinDbg加载默认的SOS.dll时,它会出现此错误:
sxe ld clr <- I wait until the clr has loaded
.loadby sos clr
The call to LoadLibrary(C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos) failed, Win32 error 0n193
"%1 is not a valid Win32 application."
Please check your debugger configuration and/or network access.
Run Code Online (Sandbox Code Playgroud)
如果我试图指定SOS.dll我收到一个不同的错误:
.load C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos clr
The call to LoadLibrary(C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos clr) failed, Win32 error 0n126
"The specified module could not be found."
Please check your debugger configuration and/or network access.
Run Code Online (Sandbox Code Playgroud)
我的设置是VM-to-VM over Serial connection,两个VM都是Windows Server 2008 R2 SP1.调试工具对于Windows(x64)安装在两个VM中.
注意: 似乎在x64 CPU上安装x86调试工具,因为此解决方案中建议在新的Windows操作系统中不可能(也没有必要),所以请不要建议.安装程序失败并显示错误.
提前感谢您的想法.
小智 10
默认情况下,安装程序似乎在没有提示的情况下将32位和64位版本的WinDbg放在系统上 - 您是否可能运行了错误的版本?
查找安装WinDbg的目录中的"x86"目录,并运行其中包含的windbg.exe版本.