How to: Collect IntelliTrace data to help debug difficult issues
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
You can configure the diagnostic data adapter for IntelliTrace to collect specific diagnostic trace information in Visual Studio. Tests can use this adapter, the test can collect significant diagnostic events for the application that a developer can use later to trace through the code to find the cause of a bug. The diagnostic data adapter for IntelliTrace can be used for either manual or automated tests.
Note
Web performance and load test functionality is deprecated. Visual Studio 2019 is the last version where web performance and load testing will be fully available. For more information, see the Cloud-based load testing service end of life blog post. To reduce the impact on users some minimum support is still available in Visual Studio 2022 Preview 3 or later. Users should also note web performance and load test functionality only supports Internet Explorer which is not available on Windows 11 and some versions of Windows 10. Read more on Internet Explorer Lifecycle policy.
Note
IntelliTrace works only on an application that is written by using managed code. If you are testing a web application that uses a browser as a client, you should not enable IntelliTrace for the client in your test settings because no managed code is available to trace. In this case, you may want to set up an environment and collect IntelliTrace data remotely on your web server.
The IntelliTrace data is stored in a file that has an extension of .iTrace. When you run your test and a test step fails, you can create a bug. The IntelliTrace file that contains the diagnostic information is automatically attached to this bug.
Note
The diagnostic data adapter for IntelliTrace does not create an IntelliTrace file when a test pass is successful. It saves a file only on a failed test case or when you submit a bug.
The data that is collected in the IntelliTrace file increases debugging productivity by reducing the time that is required to reproduce and diagnose an error in your code. Additionally, because you can share the IntelliTrace file with another individual who can replicate your local session on their computer, it reduces the probability that a bug will be non-reproducible.
Note
If you enable IntelliTrace in your test settings, collecting code coverage data will not work.
Warning
The diagnostic data adapter for IntelliTrace works by instrumenting a managed process, which must be performed after the tests for the test run are loaded. If the process that you want to monitor has already started, no IntelliTrace files will be collected because the process is already running. To circumvent this, make sure that the process is stopped before the tests are loaded. Then start the process after the tests are loaded or the first test is started.
The following procedure describes how to configure the IntelliTrace data that you want to collect. These steps apply to both the configuration editor in Microsoft Test Manager and Test Settings dialog box in Visual Studio.
Note
The user account for the test agent that is used to collect IntelliTrace data must be a member of the administrators group. For more information, see Install and configure test agents.
Configure the data to collect with the IntelliTrace diagnostic data adapter
Before you perform the steps in this procedure, you must open your test settings from either Microsoft Test Manager or Visual Studio and select the Data and Diagnostics page.
To configure the data to collect with the IntelliTrace diagnostic data adapter
Select the role to use to collect IntelliTrace data.
Select IntelliTrace.
If you are adding IntelliTrace for a web client role or for an ASP.NET web application, you must also select ASP.NET Client Proxy for IntelliTrace and Test Impact.
This proxy enables you to collect information about the http calls from a client to a web server for the IntelliTrace and Test Impact diagnostic data adapters.
Warning
If you decide to use a custom account for the identity that is being used for the application pool on the Internet Information Server (IIS) where you intend to collect IntelliTrace data, you must create the local user profile on the IIS machine for the custom account that is being used. You can create the local profile for the custom account either by logging on to the IIS machine locally one time or by running the following command line by using the custom account credentials:
runas /user:domain\name /profile cmd.exe
Choose Configure for IntelliTrace to modify default IntelliTrace settings.
The dialog box to configure the data that will be collected is displayed.
Warning
If you enable collecting IntelliTrace data, collecting code coverage data will not work.
Choose the General tab. Select IntelliTrace events only to record significant diagnostic events that have minimal impact on performance when you test.
-or-
Select IntelliTrace events and call information to record diagnostic events and method level tracing that shows call information. This level of tracing might have performance impact when you run your tests.
To collect data from your ASP.NET application that is running on Internet Information Services, select Collect data from ASP.NET applications that are running on Internet Information Services. Set up and configure your test agent on the web server role. See Install and configure test agents.
Choose the Modules tab. Select either Collect data from all modules except for the following and use Add to add to the list of modules and Remove to remove a module. This option lets you include all the modules that are running on the system except the modules that you specify.
-or-
Select Collect data from only the following modules and use Add to add to the list of modules and Remove to remove a module. This option lets you specify exactly which modules you want.
Note
If possible, select the specific processes that you want to monitor. This is recommended for optimum performance.
Choose the Processes tab. Select Collect data from all processes except for the following and use Add to add to the list of processes and Remove to remove a process. This option lets you include all the processes that are running on the system except the processes that you specify.
-or-
Select Collect data from specified processes only and use Add to add to the list of processes and Remove to remove a process. This option lets you specify exactly which processes you want.
(Optional) Choose the IntelliTrace Events tab. Select or clear each IntelliTrace event category that you want to include or exclude when you collect diagnostic events.
(Optional) Expand each IntelliTrace event category and select or clear each specific event that you want to include or exclude in the IntelliTrace events.
(Optional) Choose the Advanced tab. Next, choose the arrow next to Maximum amount of disk space for recording and select the maximum size that you want to enable for the IntelliTrace file to use.
Note
If you increase the size of the recording, a time-out issue might occur when you save this recording together with your test results.
If you are using Microsoft Test Manager (deprecated in Visual Studio 2017), choose Save. If you are using Visual Studio, choose OK. The IntelliTrace settings are now configured and saved for your test settings.
Note
To reset the configuration for this diagnostic data adapter, choose Reset to default configuration for Visual Studio or Reset to default for Microsoft Test Manager.