问题
I've started to read some materials on advanced debugging tools and techniques. I use VS2012 Ultimate and the target framework is .NET 4.0. I got to the point where I need to load SOS.dll in the Immediate window during a debug session and it just doesn't work.
I tried these with no luck
- .load sos
- .load sos.dll
- .load C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll
I always get this message:
Invalid expression term '.'
So, any idea ? What am I missing here ?
回答1:
You can change this setting to work around the issue:
Under Tools->Option->Debugging->General, check the box labeled "Managed Compatibility Mode."
That fixes the issue for me. This workaround is from http://connect.microsoft.com/VisualStudio/feedback/details/789601/-load-sos-does-not-works#
回答2:
.load C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll
works for me with VS2012 Update3
回答3:
In my case the error loading was a matter of need to use path separator as '\\' (Windbg).
来源:https://stackoverflow.com/questions/16966385/unable-to-load-sos-dll-extension-in-visual-studion-2012