locked
Error_MSB4018_The "ResolvePackageAssets" task failed unexpectedly. RRS feed

  • Question

  • 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:\Microsoft\Xamarin\NuGet\'.
       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.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
    Sunday, May 17, 2020 9:26 PM

All replies

  • Hi zxzscwe,

    There is a same thread on developer community, Maybe you could have a try this solution :

    1. Delete the NuGetFallbackFolder contents, which locates at this directory: C:\Program Files\dotnet\sdk
    2. add Newtonsoft.Json nuget package in one project
    3. Rebuild your solution

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, May 18, 2020 7:37 AM
  • I tried the above solution but still in issue 
    Wednesday, July 15, 2020 8:14 AM