"OmniSharp.MSBuild.ProjectLoader: The \"ResolvePackageAssets\" task failed unexpectedly.
art3xias23 opened this issue · 1 comments
Hi guys,
.NET 8 App
WSL2 on windows 10
Neovim 0.9
Lsp-Zero
Mason
Omnisharp
The issue is I get this line in my log file, that ultimately prevents my solution to be initialized and me having lsp functionality enabled for it.
[ERROR][2024-02-13 00:38:24] ...lsp/handlers.lua:535 "OmniSharp.MSBuild.ProjectLoader: The \"ResolvePackageAssets\" task failed unexpectedly.\nNuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages'.\n at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable
1 fallbackPackageFolders)\n at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable1 packageFolders)\n at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)\n at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash)\n at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)\n at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()\n at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()\n at Microsoft.NET.Build.Tasks.TaskBase.Execute()\n at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\n at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) | "
The issue can be resolved by:
Delete the bin and obj folders from my projects. -> causes build issues -> dotnet restore -> dotnet build -> same issue again.
The folder does exist
'C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'.
I've also copied the packages from C:\Program Files (x86)\Microsoft SDKs\NuGetPackages the the above one.
Any hints would be greatly appreciated.
Had aliases
alias dotnet=dotnet.exe
alias nuget=nuget.exe
Removed them, installed both nuget and dontet for debian and all is well.