"GetPackageDirectory" task failing unexpectedly

See original GitHub issue

Information

cc @danmoseley Linked to https://github.com/dotnet/performance/issues/2564 Starting late 08/15, when building for “Runtime=NativeAOT 7.0” with “Toolchain=ILCompiler 7.0.0-*”, our builds started hitting “The ‘GetPackageDirectory’ task failed unexpectedly”. This is different from behavior using the same settings the day before. We have public logs demonstrating the error: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-performance-refs-pull-2549-merge-ada34367314d40efb9/Partition0/1/console.e9e4522d.log?helixlogtype=result and demonstrating a successful build https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-performance-refs-heads-main-0f44758c7ce64b77aa/Partition1/1/console.7e903502.log?helixlogtype=result. Looking around I noticed the task area was updated around the same time the errors started showing up in our builds (https://github.com/dotnet/sdk/pull/27159). Could this potentially be related to those changes @LakshanF?

Exception/Failure

[2022/08/17 17:49:24][INFO] Build FAILED.
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018: The "GetPackageDirectory" task failed unexpectedly. [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018: System.ArgumentException: '7.0.0-*' is not a valid version string. (Parameter 'value') [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018:    at NuGet.Versioning.NuGetVersion.Parse(String value) [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GetPackageDirectory.ExecuteCore() [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]
[2022/08/17 17:49:24][INFO] /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(255,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/helixbot/work/B17209D2/w/A819091D/e/artifacts/bin/MicroBenchmarks/Release/net7.0/a55d87f3-9864-4d0f-b7cf-0909db2b0ba6/BenchmarkDotNet.Autogenerated.csproj]

Dotnet Info

[2022/08/17 17:48:11][INFO] $ dotnet --info
[2022/08/17 17:48:12][INFO] .NET SDK:
[2022/08/17 17:48:12][INFO]  Version:   7.0.100-rc.2.22417.1
[2022/08/17 17:48:12][INFO]  Commit:    f3da421a6e
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] Runtime Environment:
[2022/08/17 17:48:12][INFO]  OS Name:     centos
[2022/08/17 17:48:12][INFO]  OS Version:  7
[2022/08/17 17:48:12][INFO]  OS Platform: Linux
[2022/08/17 17:48:12][INFO]  RID:         centos.7-x64
[2022/08/17 17:48:12][INFO]  Base Path:   /home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk/7.0.100-rc.2.22417.1/
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] Host:
[2022/08/17 17:48:12][INFO]   Version:      7.0.0-rc.1.22411.12
[2022/08/17 17:48:12][INFO]   Architecture: x64
[2022/08/17 17:48:12][INFO]   Commit:       f52d8c59bb
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] .NET SDKs installed:
[2022/08/17 17:48:12][INFO]   7.0.100-rc.2.22417.1 [/home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/sdk]
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] .NET runtimes installed:
[2022/08/17 17:48:12][INFO]   Microsoft.AspNetCore.App 7.0.0-rc.1.22415.4 [/home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/shared/Microsoft.AspNetCore.App]
[2022/08/17 17:48:12][INFO]   Microsoft.NETCore.App 7.0.0-rc.1.22411.12 [/home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64/shared/Microsoft.NETCore.App]
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] Other architectures found:
[2022/08/17 17:48:12][INFO]   None
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] Environment variables:
[2022/08/17 17:48:12][INFO]   DOTNET_ROOT       [/home/helixbot/work/B17209D2/w/A819091D/e/tools/dotnet/x64]
[2022/08/17 17:48:12][INFO] 
[2022/08/17 17:48:12][INFO] global.json file:
[2022/08/17 17:48:12][INFO]   Not found

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
LakshanFcommented, Aug 30, 2022

The fix is in the runtime repo, https://github.com/dotnet/runtime/pull/74591

1reaction
LoopedBard3commented, Sep 1, 2022

We are no longer hitting the issue with the fix in, closing! 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "ResolvePackageAssets" task failed unexpectedly
It generally happens when the Mono's MSBuild - that is being used by Visual Studio to build the project - does not support...
Read more >
Error MSB4018 The "ResolvePackageAssets" task failed ...
Hi! Does this folder exist in your system: C:\ProgramData\Xamarin\NuGet. We use that folder to create a cache of the nugets we use on ......
Read more >
The "ResolvePackageDependencies" task failed ...
I have a complex Solution. This error I get after some Nuget Updates during build. How can I find out wich Nuget is...
Read more >
Error Code MSB4018 in Visual Studio 2022 with c# : r ...
Error MSB4018 The "ResolvePackageAssets" task failed unexpectedly. NuGet.Packaging.Core.PackagingException: Unable to find fallback package ...
Read more >
"[MSB4018] The "ResolvePackageAssets" task failed ...
The following occurs: Errors [MSB4018] The "ResolvePackageAssets" task failed unexpectedly. NuGet.Packaging.Core.PackagingException: Unable to find fallback ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found