IntelliTrace Collector for Visual Studio: The Ultimate Guide

Written by

in

How to Use IntelliTrace Collector for Visual Studio IntelliTrace is a powerful historical debugging tool in Visual Studio. It records your application’s execution history, allowing you to look back at exceptions, database queries, and system events without restarting the application.

However, you cannot always install the full Visual Studio IDE on production or test servers. This is where the IntelliTrace Standalone Collector comes in. It lets you gather debugging data from remote machines, which you can later open and analyze inside Visual Studio on your development machine.

Here is a step-by-step guide on how to set up, run, and analyze data using the IntelliTrace Collector. 1. Download and Extract the Collector

The standalone collector does not require an installation wizard. It runs as a set of files you copy directly to the target machine.

Locate or Download the Files: You can find the collector cabinet (.cab) file in your Visual Studio installation path under Common7\IDE\CommonExtensions\Microsoft\IntelliTrace, or download it directly from the Microsoft Download Center.

Copy to the Target Server: Move the file to the remote server where your application is running.

Extract the Contents: Expand the cabinet file into a dedicated directory (e.g., C:\IntelliTraceCollector) using the command line:

expand /f:Microsoft.VisualStudio.IntelliTrace.Collector.cab C:\IntelliTraceCollector Use code with caution. 2. Configure Collection Settings

Before running the collector, you need to decide how much data to log. Inside the extracted folder, you will find collection plan XML files (e.g., collection_plan.ASP.NET.default.xml).

Lightweight Logging (Default): Collects only major system events, exceptions, and debugger diagnostic data. It has a minimal performance impact.

Full Logging (Call Information): Collects method calls and detailed entry/exit parameters. This provides deep diagnostic data but will significantly slow down application performance.

To modify settings, open the desired XML plan in a text editor and configure your specific inclusions, exclusions, or data storage limits. 3. Run the Collector via PowerShell

The collector requires administrator privileges to hook into running processes or IIS application pools. For Web Applications (IIS)

To monitor an Internet Information Services (IIS) web app, use the PowerShell cmdlets provided in the collector directory: Open PowerShell as an Administrator. Import the IntelliTrace module: powershell

Import-Module “C:\IntelliTraceCollector\Microsoft.VisualStudio.IntelliTrace.PowerShell.dll” Use code with caution.

Start the collection by targeting the specific IIS Application Pool: powershell

Start-IntelliTraceCollection -ApplicationPool “YourAppPoolName” -CollectionPlan “C:\IntelliTraceCollector\collection_plan.ASP.NET.default.xml” -OutputPath “C:\IntelliTraceLogs” Use code with caution. For Standalone Executables (.NET Apps)

If you are debugging a standard console or desktop app, launch the app directly through the tool using the command line:

IntelliTraceSC.exe launch /cp:“C:\IntelliTraceCollector\collection_plan.Launcher.default.xml” /f:“C:\IntelliTraceLogs\AppLog.itrace” “C:\YourApp\YourApplication.exe” Use code with caution. 4. Stop Collection and Export the Log

Once your application reproduces the error or completes its test run, you need to finalize the log file (.itrace). For IIS applications, stop the collection using PowerShell: powershell

Stop-IntelliTraceCollection -ApplicationPool “YourAppPoolName” Use code with caution.

This detaches the collector and releases the .itrace file, saving it safely to your designated output path. 5. Analyze the Log in Visual Studio

Move the generated .itrace file back to your development machine to inspect the results.

Open Visual Studio Enterprise (note: IntelliTrace viewing requires the Enterprise edition). Double-click or open the .itrace file. Review the IntelliTrace Summary Page, which displays:

Exception Data: A list of all thrown exceptions, even those caught by the app. Web Requests: A timeline of incoming HTTP requests. Threads List: Active threads during execution.

Click on a specific exception or event and select Start Debugging.

Visual Studio will enter a historical debugging state. You can view the call stack, look at variables, and see exactly what code executed at the moment the issue occurred on the remote server.

To help me tailor any troubleshooting steps, could you tell me:

What type of application are you trying to profile? (e.g., IIS Web App, Azure App Service, or Console App) What version of Visual Studio are you using?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *