Camile
Camile

Reputation: 175

Visual Studio 2017: The "ResolvePackageAssets" task failed unexpectedly

Using Visual Studio Community 2017 for Mac

I downloaded this version to open an 1+ year old project, and when I try to build and run, I get this error:

Image here

Any tips on what to do here? Have tried google'ing, but with no luck.

Upvotes: 0

Views: 6152

Answers (2)

pejman mirzaee
pejman mirzaee

Reputation: 19

for vs 2019 windows: 1.unload project 2.load project 3.try uninstall package form nuget manager then automatically fix all but u need

Upvotes: 0

Matt Ward
Matt Ward

Reputation: 47937

The error message is:

TypeLoadException: Could not resolve type with token 01000063 from typeref (expected class 'NuGet.Packaging.Core.PackageDependency' in assembly 'NuGet.Packaging, Version=5.3.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35')

Also it looks like you have .NET Core SDK 3.0 installed.

The problem is that your MSBuild version (that is shipped with Mono) is incompatible with the .NET Core SDK you have installed. NuGet had some breaking changes which means that a particular Mono version can only support a particular set of .NET Core SDKs.

Your options are:

  1. Update to a more recent Visual Studio for Mac.
  2. Use a global.json file to target a specific .NET Core SDK version.
  3. Uninstall all .NET Core SDKs apart from the version that is supported by the version of Visual Studio for Mac you are using.

Currently only the Visual Studio for Mac version 8 dependencies on the .NET Core SDK versions are listed.

For Visual Studio for Mac 2017 (version 7.x) you would likely need .NET Core 2.1.5xx or older.

Upvotes: 1

Related Questions