Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error VS2019 for Mac Preview 3 'The "ResolvePackageAssets" task failed unexpectedly.' #2461

Closed
aaronmbos opened this issue Mar 15, 2019 · 14 comments
Assignees

Comments

@aaronmbos
Copy link

Issue Build Error VS2019 for Mac Preview 3 'The "ResolvePackageAssets" task failed unexpectedly.'

General

.NET Core SDK Version: 3.0.100-preview3-010431
IDE: Visual Studio 2019 for Mac (Preview 3)

After installing .NET Core 3.0 sdk I am no longer able to build my WebAPI project through Visual Studio. It seems to build fine using "dotnet build" with CLI. Prior to installing and updating the WebAPI project to ASP.NET Core 3.0 (Preview 3), I didn't have any issues building through Visual Studio. If I can provide anymore helpful information, please just let me know. Below is the description of the error I am receiving.

/usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5): Error MSB4018: The "ResolvePackageAssets" task failed unexpectedly.
System.TypeLoadException: Could not resolve type with token 0100003f from typeref (expected class 'NuGet.Packaging.Core.PackageDependency' in assembly 'NuGet.Packaging, Version=5.0.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35')
at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheWriter.GetPlatformPackageExclusions () [0x000d7] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheWriter..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.IO.Stream stream) [0x0009b] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash) [0x0003a] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00015] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups () [0x00000] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore () [0x00018] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <9524e6fbf1724027a475d15b01fab866>:0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:573
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:784

@leecow
Copy link
Member

leecow commented Mar 15, 2019

Possibly related to #2460?

@sergiotapia
Copy link

Same

@ovicrisan
Copy link

Same thing here, but also for VS 2017 targeting ASP.NET Core 2.2, not only for 3.0 preview. My previous projects don't work anymore in VS after installing .NET Core 3.0 preview. Very annoying.

@leecow
Copy link
Member

leecow commented Mar 18, 2019

@ovicrisan - you need to use the VS 2019 Previews in order to work with .NET Core 3.0 Previews. 3.0 will not be supported from VS 2017.

@ovicrisan
Copy link

I wasn't explicit enough: beside VS 2019 not working after installing .NET Core 3.0 preview 3, also my previous (side-by-side) VS 2017 targeting .NET Core 2.2 doesn't work any more.
Building and running it from CLI works fine, but not from VS. This is from VS 2017 w/ .NET Core 2.2 project:

Screen Shot 2019-03-18 at 11 00 45 PM

@ovicrisan
Copy link

I've just uninstalled .NET 3.0 preview3 as described here https://docs.microsoft.com/en-us/dotnet/core/versions/remove-runtime-sdk-versions?tabs=macos and everything works fine now:

$ dotnet --list-sdks
[...]
3.0.100-preview3-010431 /usr/local/share/dotnet/sdk
$ sudo rm -rf /usr/local/share/dotnet/sdk/3.0.100-preview3-010431

$ dotnet --list-runtimes
[...]
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App
Microsoft.NETCore.App 3.0.0-preview3-27503-5 /usr/local/share/dotnet/shared/Microsoft.NETCore.App

$ sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/Microsoft.AspNetCore.App 3.0.0-preview3-19153-02
$ sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/Microsoft.NETCore.App 3.0.0-preview3-27503-5

@karelz
Copy link
Member

karelz commented Mar 30, 2019

Is there still a problem to resolve in VS 2019 for Mac? Or does the last reply mean there is a way to resolve it?
cc @mhutch

@JordanPritt
Copy link

I'm experiencing the same issue. Unless you completely remove the core 3.0 preview SDK, all .NET core projects stop building on either version of VS for Mac.

@aaronmbos
Copy link
Author

I'm no longer receiving the same error that I started this issue with. I'm now seeing the error below when I try to build.
Error: The version of the .NET Core SDK currently installed (/usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks) is not supported and continuing to use it may result in a broken tooling experience.

@karelz
Copy link
Member

karelz commented Mar 31, 2019

@JordanPritt any idea why is your experience different from @aaronmbos ?

@mhutch
Copy link
Member

mhutch commented Mar 31, 2019

See #2460 (comment)

@JordanPritt
Copy link

@karelz I’m not certain what you’re asking. Could you elaborate please? Thanks

@karelz
Copy link
Member

karelz commented Apr 1, 2019

@JordanPritt it is unclear if there is anything left to address and if everyone is seeing the same problems.

@karelz
Copy link
Member

karelz commented Apr 1, 2019

Duplicate of #2460

@karelz karelz marked this as a duplicate of #2460 Apr 1, 2019
@karelz karelz closed this as completed Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants