Debugging with IntelliTrace

This topic applies to Visual Studio 2010 Ultimate only.

Debugging with IntelliTrace, available in Microsoft Visual Studio 2010 Ultimate, provides an enhanced picture of your application compared with traditional debuggers. Traditional debuggers show you the state of your application at the current time with limited information about events that occurred in the past. You must either infer events that occurred in the past, based on the state of your application at the current time, or restart the application to re-create past events. With IntelliTrace, you can actually see events that occurred in the past and the context in which they occurred. This reduces the number of restarts that are required to debug your application and the possibility that an error will fail to reproduce when you rerun the application.

IntelliTrace extends and enhances the Visual Studio live debugging experience that you are used to. You still have access to all the Visual Studio debugger features that you are familiar with. IntelliTrace operates invisibly in the background, recording debug information. When you want to look back at a past state of your application, you can enter IntelliTrace mode. In this mode, you can navigate to various points in time where events of interest have been recorded.

You can also load and debug an IntelliTrace file, which has a .iTrace extension, Created by IntelliTrace or Test Manager, IntelliTrace files allow you to perform post-crash debugging with all the power of IntelliTrace.

When you use the default settings, IntelliTrace has minimal effect on application performance. Therefore, IntelliTrace is turned on by default. Even if you did not plan to use IntelliTrace when you started your debugging session, IntelliTrace information is collected automatically and available when you need it.

Debugging code faster

IntelliTrace can save time by shortening the debugging cycle. For example, suppose that you are debugging an application that reads a registry value during initialization, but the registry key does not exist. The effect of that problem might not be noticeable until much later in the run of your application. Then, you must determine why the registry value was not read. The usual approach is to restart the application and place a breakpoint near the registry access. Rerunning the application takes time. With IntelliTrace, you can avoid many such restarts. Instead of rerunning your application, you can begin debugging with IntelliTrace, which enables you to look back at all registry accesses, choose the one that interests you, and examine the state of your application when that registry access occurred. You might experience similar time savings when you debug other problems such as an exception or a file access error. For more information, see Debugging Code Faster with IntelliTrace.

Debugging non-reproducible errors

IntelliTrace lets you debug errors and crashes that would otherwise be non-reproducible. You can debug log files that were created by IntelliTrace or by Test Manager. A tester can link a log file from Test Manager directly to a Team Foundation Server work item or bug, which can be assigned to a developer. In this way, IntelliTrace and Test Manager integrate into your team workflow.

When you debug an IntelliTrace file, the process is similar to debugging a dump file. However, IntelliTrace files provide much more information than traditional dump files. A dump file provides a snapshot of an application's state at one moment in time, usually just when it crashed. With IntelliTrace, you can rewind the history to see the state of the application and events that occurred earlier in the application run. This makes debugging from a log file faster and easier than debugging from a dump file.

For more information, see Debugging Non-Reproducible Errors With IntelliTrace.

Supported applications and debugging scenarios

IntelliTrace supports debugging Visual Basic and C# applications that use .NET version 2.0, 3.0, 3.5, or 4. You can debug most applications, including applications that were created by using ASP.NET, Windows Forms, WPF, Windows Workflow, and WCF. IntelliTrace does not support debugging C++, script, or other languages. Debugging of F# applications is supported on an experimental basis.

With IntelliTrace, you can debug applications launched from Visual Studio and IntelliTrace files that were created by IntelliTrace or Test Manager. You cannot use IntelliTrace with applications launched outside Visual Studio and debugged using the Attach to command. IntelliTrace does not support remote debugging of applications that are running on other computers.

IntelliTrace supports post-crash debugging of SharePoint applications and 64-bit applications through trace debugging log files created by Test Manager. It does not support debugging SharePoint applications or 64-bit applications launched from Visual Studio.

IntelliTrace does not support debugging of Silverlight, Xbox, or Windows Mobile applications.

Collection levels

When IntelliTrace is enabled, information is collected automatically during every debugging session. This IntelliTrace information enables you to switch from live debugging to debugging with IntelliTrace when you need to. The type of information collected is determined by options that you set at the Visual Studio level. These collection options apply to all projects and solutions. They persist between debug sessions and Visual Studio sessions.

By default, IntelliTrace collects information for selected IntelliTrace events only. As stated before, collecting this default information has a minimal effect on the performance your application.

For more debugging power, you can choose to collect a record of calls, together with their parameters and returns values, in addition to the IntelliTrace events. This additional debugging power has a performance cost. For more information about diagnostic events and collection options, see Collecting IntelliTrace Information.

See Also

Concepts

Performing Common Development Tasks

Other Resources

API Reference for IntelliTrace Extensibility