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 debug (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: http://msdn.microsoft.com/en-us/windows/hardware/gg463009
- Install this Debug Tools in: “c:\tools\debug”
- Download Sysinternals: http://technet.microsoft.com/en-us/sysinternals/bb842062
- 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":
- 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 instantiates 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
- How to use a symbol server with the Visual Studio .NET debugger: http://support.microsoft.com/kb/319037
- INFO: Choosing the Debugger That the System Will Spawn: http://support.microsoft.com/kb/103861
Once again I want to thank Jorge Lourenço for help!
Tags: BizTalk | Debug | .NET

[...] http://sandroaspbiztalkblog.wordpress.com/2011/05/26/steps-to-prepare-your-biztalk-environment-for-d… [...]