Steps to prepare your BizTalk environment for diagnostics

Posted: May 26, 2011  |  Categories: Administration BizTalk Visual Studio

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.

  1. Download the Debug Tools: https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
  2. Install this Debug Tools in: “c:\tools\debug”
  3. Download Sysinternals: https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
  4. Unzip the tools to: “c:\tools\bin”
  5. Go to “Control Panel System Advanced Environment Variables”
    control panel Environment Variables
  6. In “System Variables” section, press “New” and add the following variable:
    1. Variable name: “_NT_SYMBOL_PATH
    2. Variable value: “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
control panel Environment Variables-new-system-variable
  1. In the “User variables for user” section, press “New” and add the following variable:
    1. Variable name: “PATH
    2. Variable value: “C:\tools\bin
control panel Environment Variables new user variable
  1. Press the OK button twice.

Step 2: Prepare theProcess Monitor”

  1. Run procmon.exe
    run procmon
  2. Go to the menu option “Options Configure Symbols”
    procmon Configure Symbols
  3. 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
  4. Ensure that the “Symbol Path” is equal to “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols”
    procmon Configure-Symbols-values
  5. Press OK button

Step 3: Prepare theProcess Explorer

  1. Run “procexp.exe
    run-procexp
  2. Go to the menu option “Options Configure Symbols”
    procexp-Configure-Symbols
  1. 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
  2. Ensure that the “Symbol Path” is equal to “SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols”
    procexp Configure Symbols values
  3. 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

Once again I want to thank Jorge Lourenço for help!

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

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

Leave a Reply

Your email address will not be published.

BizTalk360
BizTalk Server

Over 650+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Operate efficiently with enterprise-grade Azure monitoring,
tracing, remediation & governance in one platform

Learn More

Back to Top