How to: Collect IntelliTrace Data to Help Debug Difficult Issues
Using Microsoft Test Manager or Microsoft Visual Studio 2010, you can configure the diagnostic data adapter for IntelliTrace to collect specific diagnostic trace information. 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
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. For more information about environments, see Setting Up Test Machines to Run Tests or Collect Data.
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.
Warning
If you enable IntelliTrace in your test settings, collecting code coverage data will not work. For more information, see How to: Configure Code Coverage Using Test Settings for Automated Tests
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 Microsoft Visual Studio 2010.
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 Installing and Configuring Visual Studio Agents and Test and Build Controllers.
Tip
Test Attachment Cleaner
The data that the IntelliTrace diagnostic data adapter captures can use a lot of database space over time. The administrator of the database used for Visual Studio 2010 cannot control what data gets attached as part of test runs. For example, there are no policy settings that can limit the size of the data captured and there is not a retention policy to determine how long to hold this data before initiating a cleanup. You can use the test attachment cleaner tool to:
-
Determine how much database space each set of diagnostic data captures is using.
-
Reclaim the space for runs that are no longer relevant from a business perspective.
For more information and to download the test attachment cleaner tool, see Test Attachment Cleaner for Visual Studio Ultimate 2010 & Test Professional 2010.
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 Microsoft Visual Studio 2010 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, 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
Click 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.
Click 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.
If you want 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.
Click 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.
Click 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) Click 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.
Note
For more information, see Collecting IntelliTrace Information.
(Optional) Click the Advanced tab. Next, click 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. For more information about how to increase the time-out values for diagnostic data adapters, see How to: Prevent Time-Outs for Diagnostic Data Adapters.
If you are using Microsoft Test Manager, click Save. If you are using Visual Studio, click OK. The IntelliTrace settings are now configured and saved for your test settings.
Note
To reset the configuration for this diagnostic data adapter, click Reset to default configuration for Visual Studio or Reset to default for Microsoft Test Manager.
See Also
Tasks
Create Test Settings for Manual Tests
Create Test Settings for Automated Tests as Part of a Test Plan
Create Test Settings to Run Automated Tests from Visual Studio
Concepts
Setting Up Machines and Collecting Diagnostic Information Using Test Settings
Other Resources
Including Diagnostic Trace Data with Bugs that are Difficult to Reproduce