90 likes | 243 Views
.NET Debugging for the Production Environment. Part 3: WinDbg & SOS. Brad Linscott. Premier Field Engineer ing. Agenda. Windbg intro Debugging .NET applications with Windbg A common problem when trying to load SOS. WinDbg Intro. Part of Debugging Tools for Windows package
E N D
.NET Debugging for the Production Environment Part 3: WinDbg & SOS Brad Linscott Premier Field Engineer ing
Agenda • Windbg intro • Debugging .NET applications with Windbg • A common problem when trying to load SOS
WinDbg Intro • Part of Debugging Tools for Windows package • Free download on Microsoft’s web site • Xcopy-deployable • Automatable (ADPlus), live, post-mortem (production!) • Why use WinDbg/cdb instead of Visual Studio?
WinDbg, cont’d • Unaware of .NET • SOS/psscor2/psscor4 • Symbols – needed with managed debugging? • Saving your workspace in Windbg
.Debugging .NET apps with WinDbg • Command window is “main” window • Load sos/psscor2/psscor4 • .load <extension name>
Common problem loading SOS/psscor2/psscor4 • “Failed to load data access dll”
Common problem loading SOS/psscor2/psscor4 • What is the ‘dac’? • Common root causes of “failed to load” with sos • Download from symbol server • Not using the right dac – copy from the target machine • Debugger/debuggee architecture mismatch
Problem loading SOS/psscor2/psscor4, cont’d • Recommended troubleshooting steps: • Use .cordll, as suggested • Ensure the right dac is used • Debugger/debuggee mismatch
Summary • Two simple rules when dumping/debugging managed applications: • Dump 32-bit applications with a 32-bit debugger, and open the dump with a 32-bit debugger. • Dump 64-bit applications with a 64-bit debugger, and open the dump with a 64-bit debugger. • Keeping architectures aligned will eliminate this problem 90% of the time