MSBuild version 18.8.2+ce25c0108 for .NET Framework crashes with NRE in telemetry classes.
MSBuild version 18.8.2+ce25c0108 for .NET Framework
Build started 22.07.2026 11:51:08.
[...]
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.Framework.Telemetry.VsTelemetryInitializer.Dispose()
at Microsoft.Build.Framework.Telemetry.TelemetryManager.DisposeVsTelemetry()
at Microsoft.Build.Framework.Telemetry.TelemetryManager.Dispose()
at Microsoft.Build.Execution.BuildManager.Dispose(Boolean disposing)
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean multiThreaded, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isTaskAndTargetItemLoggingRequired, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, Boolean reportFileAccesses, String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
OnUnhandledException: Object reference not set to an instance of an object.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.Framework.Telemetry.CrashTelemetryRecorder.PostFaultEvent(CrashTelemetry crashTelemetry)
at Microsoft.Build.Framework.Telemetry.CrashTelemetryRecorder.RecordAndFlushCrashTelemetry(Exception exception, CrashExitType exitType, Boolean isUnhandled, Boolean isCritical)
I've seen similar telemetry related crashes with earlier versions of VS 2026 and 2022, and the following environment used to help, but no longer:
Issue Description
MSBuild version 18.8.2+ce25c0108 for .NET Framework crashes with NRE in telemetry classes.
Steps to Reproduce
nre-crash-msbulid-18.8.2.zip
Actual Behavior
MSBuild version 18.8.2+ce25c0108 for .NET Framework Build started 22.07.2026 11:51:08. [...] MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Build.Framework.Telemetry.VsTelemetryInitializer.Dispose() at Microsoft.Build.Framework.Telemetry.TelemetryManager.DisposeVsTelemetry() at Microsoft.Build.Framework.Telemetry.TelemetryManager.Dispose() at Microsoft.Build.Execution.BuildManager.Dispose(Boolean disposing) at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean multiThreaded, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isTaskAndTargetItemLoggingRequired, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, Boolean reportFileAccesses, String[] commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine) OnUnhandledException: Object reference not set to an instance of an object. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Build.Framework.Telemetry.CrashTelemetryRecorder.PostFaultEvent(CrashTelemetry crashTelemetry) at Microsoft.Build.Framework.Telemetry.CrashTelemetryRecorder.RecordAndFlushCrashTelemetry(Exception exception, CrashExitType exitType, Boolean isUnhandled, Boolean isCritical)Analysis
I've seen similar telemetry related crashes with earlier versions of VS 2026 and 2022, and the following environment used to help, but no longer:
Versions & Configurations
Windows Server 2022
VS 2026 and VS2022 side by side
github actions runner