In the past, I published an article about an unhandled exception (‘<System.StackOverflowException>’) that 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.
📝 One-Minute Brief
Preparing a BizTalk environment for deep diagnostics requires more than just checking Event Viewer. This guide details how to set up the Microsoft Symbol Server and configure advanced troubleshooting tools like Process Monitor (ProcMon) and Process Explorer. By configuring environment variables for symbol paths and linking them to diagnostic tools, developers can capture detailed .NET stack traces when unhandled exceptions (like StackOverflowException) occur, allowing for precise pinpointing of the failing code within the BTSNTSvc.exe process.
Step 1: Prepare the environment for debugging (set up the Symbol Server)
First note: if you are using a Lab environment with Visual Studio, like me, skip steps 1 and 2.
- Download the Debug Tools: https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
- Install these 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 the 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 the 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 the 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!
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.

1 thought on “Steps to prepare your BizTalk environment for diagnostics”