visual-studionuget

NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Progress\ToolboxNugetPackages'


I'm getting this error on a new Windows 10 Enterprise 2004 installation with the latest version of Visual Studio 2019 Enterprise installed. I am just trying to compile a stock .NET Core Console app; I get this error when I try to build the solution.

    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)\Progress\ToolboxNugetPackages'.
       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() ConsoleApp1  
     C:\Program 
     
     Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets   
   234  

Solution

  • I found the problem - one of the installers for a WPF Control I have been using for a while has a bug where it now generates a nuget package cache for UI Controls; the Nuget package does exist and but it's in the wrong location. This specific bug is made manifest when one changes the default installation directory 'C:\Program Files (x86)\Progress'. To remedy the situation I copied the Nuget Cache to the expectant location and the problem went away.