documentation/VS-Telemetry-Data.md
This document describes the telemetry data collected by MSBuild and sent to Visual Studio telemetry infrastructure. The telemetry helps the MSBuild team understand build patterns, identify issues, and improve the build experience.
MSBuild collects telemetry at multiple levels:
All telemetry events use the VS/MSBuild/ prefix as required by VS exporting/collection. Properties use the VS.MSBuild. prefix.
build event)The primary telemetry event capturing overall build information.
| Property | Type | Description |
|---|---|---|
BuildDurationInMilliseconds | double | Total build duration from start to finish |
InnerBuildDurationInMilliseconds | double | Duration from when BuildManager starts (excludes server connection time) |
BuildEngineHost | string | Host environment: "VS", "VSCode", "Azure DevOps", "GitHub Action", "CLI", etc. |
BuildSuccess | bool | Whether the build succeeded |
BuildTarget | string | The target(s) being built |
BuildEngineVersion | Version | MSBuild engine version |
BuildEngineDisplayVersion | string | Display-friendly engine version |
BuildEngineFrameworkName | string | Runtime framework name |
BuildCheckEnabled | bool | Whether BuildCheck (static analysis) was enabled |
MultiThreadedModeEnabled | bool | Whether multi-threaded build mode was enabled |
SACEnabled | bool | Whether Smart Application Control was enabled |
IsStandaloneExecution | bool | True if MSBuild runs from command line |
InitialMSBuildServerState | string | Server state before build: "cold", "hot", or null |
ServerFallbackReason | string | If server was bypassed: "ServerBusy", "ConnectionError", or null |
ProjectPath | string | Path to the project file being built |
FailureCategory | string | Primary failure category when build fails (see Error Categorization) |
ErrorCounts | object | Breakdown of errors by category (see Error Categorization) |
When a build fails, errors are categorized to help identify the source of failures.
| Category | Error Code Prefixes | Description |
|---|---|---|
Compiler | CS, FS, VBC | C#, F#, and Visual Basic compiler errors |
MsBuildGeneral | MSB4001-MSB4099, MSB4500-MSB4999 | General MSBuild errors |
MsBuildEvaluation | MSB4100-MSB4199 | Project evaluation errors |
MsBuildExecution | MSB4300-MSB4399, MSB5xxx-MSB6xxx | Build execution errors |
MsBuildGraph | MSB4400-MSB4499 | Static graph build errors |
Task | MSB3xxx | Task-related errors |
SdkResolvers | MSB4200-MSB4299 | SDK resolution errors |
NetSdk | NETSDK | .NET SDK errors |
NuGet | NU | NuGet package errors |
BuildCheck | BC | BuildCheck rule violations |
NativeToolchain | LNK, C1xxx-C4xxx, CL | Native C/C++ toolchain errors (linker, compiler) |
CodeAnalysis | CA, IDE | Code analysis and IDE analyzer errors |
Razor | RZ | Razor compilation errors |
Wpf | XC, MC | WPF/XAML compilation errors |
AspNet | ASP, BL | ASP.NET and Blazor errors |
Other | (all others) | Uncategorized errors |
build/tasks/taskfactory)Tracks which task factories are being used.
| Property | Type | Description |
|---|---|---|
AssemblyTaskFactoryTasksExecutedCount | int | Tasks loaded via AssemblyTaskFactory |
IntrinsicTaskFactoryTasksExecutedCount | int | Built-in intrinsic tasks |
CodeTaskFactoryTasksExecutedCount | int | Tasks created via CodeTaskFactory |
RoslynCodeTaskFactoryTasksExecutedCount | int | Tasks created via RoslynCodeTaskFactory |
XamlTaskFactoryTasksExecutedCount | int | Tasks created via XamlTaskFactory |
CustomTaskFactoryTasksExecutedCount | int | Tasks from custom task factories |
Classifies builds as full or incremental based on target execution patterns.
| Field | Type | Description |
|---|---|---|
Classification | enum | Full, Incremental, or Unknown |
TotalTargetsCount | int | Total number of targets |
ExecutedTargetsCount | int | Targets that ran |
SkippedTargetsCount | int | Targets that were skipped |
SkippedDueToUpToDateCount | int | Skipped because outputs were current |
SkippedDueToConditionCount | int | Skipped due to false condition |
SkippedDueToPreviouslyBuiltCount | int | Skipped because already built |
IncrementalityRatio | double | Ratio of skipped to total (0.0-1.0) |
A build is classified as Incremental when more than 70% of targets are skipped.
Custom and potentially sensitive data is hashed using SHA-256 before being sent:
The following Microsoft-owned task factory names are sent in plain text:
AssemblyTaskFactoryTaskHostFactoryCodeTaskFactoryRoslynCodeTaskFactoryXamlTaskFactoryIntrinsicTaskFactory| File | Description |
|---|---|
| BuildTelemetry.cs | Main build telemetry class |
| BuildInsights.cs | Container for detailed insights |
| TelemetryDataUtils.cs | Data transformation utilities |
| BuildErrorTelemetryTracker.cs | Error categorization |
| ProjectTelemetry.cs | Per-project task telemetry |
| LoggingConfigurationTelemetry.cs | Logger configuration |
| BuildCheckTelemetry.cs | BuildCheck telemetry |
| KnownTelemetry.cs | Static telemetry accessors |
| TelemetryConstants.cs | Telemetry naming constants |