Home > Back-end >  Unable to find fallback package folder "NuGet & VS2019" Error
Unable to find fallback package folder "NuGet & VS2019" Error

Time:07-28

How to resolve this issue? VS2019 Just created a new .Net Core 3.1 Windows Application and built the Project

I was not able to follow this answer here! it is not clear

Severity    Code    Description Project File    Line    Suppression State
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 fallbackPackageFolders)
   at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
   at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(LockFile lockFile)
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets 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.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() WinFormsApp1    C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets    241

CodePudding user response:

According to your description you can manually create the folder C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages to solve the problem.

This page can give you more information about the issue.

CodePudding user response:

For others who stumbled at the same issue

I managed to overcome the Error by copying the NuGetPackages folder

FROM

C:\Program Files (x86)\Microsoft SDKs\NuGetPackages

TO

C:\Program Files (x86)\Microsoft Visual Studio\Shared\
  • Related