NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

StaticGraphRestore Fails with NETSDK1004 in Some Scenarios #10307

Closed aolszowka closed 3 years ago

aolszowka commented 3 years ago

Details about Problem

NuGet product used: MSBuild /restore

Microsoft (R) Build Engine version 16.8.1+bd2ea1e3c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

16.8.1.52902

OS version (i.e. win10 v1607 (14393.321)): Windows Server 1809 17763.1397

Worked before?: Yes, without StaticGraph

Detailed repro steps so we can see the same problem

Unclear on what exactly is happening here, but when using /p:RestoreUseStaticGraphEvaluation=true to get Static Graph we error with the following:

"S:\mobile\All\All.sln" (Build target) (1:2) ->
       "S:\mobile\Core\UserInterface\XX.MobileCore.UserInterface\XX.MobileCore.UserInterface.csproj" (default target) (7:2) ->
       (ResolvePackageAssets target) -> 
         C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1004: Assets file 'S:\mobile\Core\UserInterface\XX.MobileCore.UserInterface\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [S:\mobile\Core\UserInterface\XX.MobileCore.UserInterface\XX.MobileCore.UserInterface.csproj]

Not using Static Graph (IE not defining the switch) works just fine.

We're motivated to help solve the issue, but we are constrained as to giving you code that repros (we don't have time to narrow it down blindly, please give guidance)