Skip to content

WSL dotnet clean error MSB4018 The "ResolvePackageAssets" task failed unexpectedly. #46881

Open
@cschuchardt88

Description

@cschuchardt88

Describe the bug

When running dotnet clean on my projects solution file I get an error with Microsoft.PackageDependencyResolution.targets of MSB4018. Not sure if other projects have this problem. I am using Ubuntu 24.04.1 LTS in WSL. This is clean install of dotnet sdk.

To Reproduce

My project is too complex. However it should still be a problem. If the dotnet sdk only works with basic projects then what's the point of supporting all the features in dotnet. So I'm not going to bother to even upload project or reference it.

Exceptions (if any)

This on every project, in the solution.

RpcServer failed with 1 error(s) (0.2s)
    /usr/lib/dotnet/sdk/9.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error MSB4018:
      The "ResolvePackageAssets" task failed unexpectedly.
      NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86
      )\Microsoft Visual Studio\Shared\NuGetPackages'.
         at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallba
      ckPackageFolders)
         at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
         at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
         at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAs
      sets task, Byte[] settingsHash)
         at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
         at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
         at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
         at Microsoft.NET.Build.Tasks.TaskBase.Execute()
         at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
         at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost,
       TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToE
      xecuteTask)

Further technical details

// uname -a
Linux PC01 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

// dotnet --info
.NET SDK:
 Version:           9.0.103
 Commit:            c4e5fd73fe
 Workload version:  9.0.100-manifests.e611c4b6
 MSBuild version:   17.12.24+c4e5fd73f

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  24.04
 OS Platform: Linux
 RID:         ubuntu.24.04-x64
 Base Path:   /usr/lib/dotnet/sdk/9.0.103/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.2
  Architecture: x64
  Commit:       c4e5fd73fe

.NET SDKs installed:
  8.0.112 [/usr/lib/dotnet/sdk]
  9.0.103 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.12 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.2 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.12 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.2 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  /mnt/r/github/cschuchardt88/neo/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions