In the past, I publish an article about “An unhandled exception (‘<System.StackOverflowException>’) occurred in BTSNTSvc.exe” with the promise that I would explain in detail how I was able to debug the .NET stack using the Microsoft Symbol Server to obtain debug symbol files and now is the time.
Step 1: Prepare the environment for debugging (set up the Symbol Server)
First one note: if you are using a Lab environment with Visual Studio, like me, skip step 1 and 2.
- Download the Debug Tools: https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
- Install this Debug Tools in: “c:\tools\debug”
- Download Sysinternals: https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
- Unzip the tools to: “c:\tools\bin”
- Go to “Control Panel ➤ System ➤ Advanced ➤ Environment Variables”
- In “System Variables” section, press “New” and add the following variable:
- Variable name: “_NT_SYMBOL_PATH”
- Variable value: “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols”
- In the “User variables for user” section, press “New” and add the following variable:
- Variable name: “PATH”
- Variable value: “C:\tools\bin”
- Press the OK button twice.
Step 2: Prepare the “Process Monitor”
- Run procmon.exe
- Go to the menu option “Options ➤ Configure Symbols”
- Ensure that the “DBGHELP.DLL” path is equal to “C:\TOOLS\DEBUG\dbghelp.dll” or is one path of the version used in Visual Studio
- Ensure that the “Symbol Path” is equal to “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols”
- Press OK button
Step 3: Prepare the “Process Explorer“
- Run “procexp.exe”
- Go to the menu option “Options ➤ Configure Symbols”
- Ensure that the “DBGHELP.DLL” path is equal to “C:\TOOLS\DEBUG\dbghelp.dll” or is one path of the version used in Visual Studio
- Ensure that the “Symbol Path” is equal to “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols”
- Press OK button
Now when the exception occurs, the system will automatically instantiate one Visual Studio instance with the trace .NET stack, giving me the exact point of the problem.
References
- Use the Microsoft Symbol Server to obtain debug symbol files: http://support.microsoft.com/kb/311503
Once again I want to thank Jorge Lourenço for help!
1 thought on “Steps to prepare your BizTalk environment for diagnostics”