You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NuGet.RestoreEx.targets "Object reference not set" during tvos RuntimeTests restore #126461
{
"ErrorMessage": "NuGet.RestoreEx.targets(19,5): error : Object reference not set to an instance of an object",
"ErrorPattern": "",
"BuildRetry": true,
"ExcludeConsoleLog": true
}
Summary
NuGet restore fails with a NullReferenceException in MSBuildStaticGraphRestore.GetDependencyGraphSpec during RuntimeTests build on tvos legs:
.dotnet/sdk/11.0.100-preview.3.26170.106/NuGet.RestoreEx.targets(19,5): error : Object reference not set to an instance of an object.
at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.<GetDependencyGraphSpec>b__37_3(RestoreProjectAdapter project)
at NuGet.Build.Tasks.Console.MSBuildStaticGraphRestore.<>c__DisplayClass38_0`1.<GetDependencyGraphSpec>b__0(KeyValuePair`2 project)
Note
This issue was filed with the assistance of GitHub Copilot.
This appears to be a known NuGet static graph restore bug — NuGet/Home#11680 — where OuterBuild is null for a referenced multi-targeting project because MSBuild's ProjectGraph omits the outer build node. I've posted a detailed analysis and a proposed interim fix there: NuGet/Home#11680
Why this hits tvOS specifically
The tvOS runtime tests build configuration likely references a project that multi-targets (e.g. TargetFrameworks including a tvOS TFM alongside another). When the project graph only contains inner build nodes for that dependency (no outer build evaluation), NuGet's new PackageSpecFactory code path dereferences the null OuterBuild property and throws an NRE.
The 3 hits/month likely reflects how often the tvOS leg runs rather than intermittency — the bug should be deterministic for a given project graph topology.
Note
This analysis was produced with the assistance of GitHub Copilot, prompted by @danmoseley.
We're hitting the same error when using BenchmarkDotNet framework. It builds optimized projects on the fly to run benchmarks, and some of the projects have multiple TF. Is there a workaround, apart from TF manipulation?
Activity
dotnet-policy-service commentedon Apr 2, 2026
Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.
danmoseley commentedon Apr 8, 2026
This appears to be a known NuGet static graph restore bug — NuGet/Home#11680 — where OuterBuild is null for a referenced multi-targeting project because MSBuild's ProjectGraph omits the outer build node. I've posted a detailed analysis and a proposed interim fix there: NuGet/Home#11680
Why this hits tvOS specifically
The tvOS runtime tests build configuration likely references a project that multi-targets (e.g. TargetFrameworks including a tvOS TFM alongside another). When the project graph only contains inner build nodes for that dependency (no outer build evaluation), NuGet's new PackageSpecFactory code path dereferences the null OuterBuild property and throws an NRE.
The 3 hits/month likely reflects how often the tvOS leg runs rather than intermittency — the bug should be deterministic for a given project graph topology.
Note
This analysis was produced with the assistance of GitHub Copilot, prompted by @danmoseley.
olstakh commentedon May 6, 2026
We're hitting the same error when using BenchmarkDotNet framework. It builds optimized projects on the fly to run benchmarks, and some of the projects have multiple TF. Is there a workaround, apart from TF manipulation?