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 GenerateDepFiles .NET 3.0.100-preview3-010431 [OSX] #2460

Closed
lab7734 opened this issue Mar 14, 2019 · 27 comments
Closed

Build error GenerateDepFiles .NET 3.0.100-preview3-010431 [OSX] #2460

lab7734 opened this issue Mar 14, 2019 · 27 comments

Comments

@lab7734
Copy link

lab7734 commented Mar 14, 2019

Build error GenerateDepFiles .NET 3.0.100-preview3-010431 [OSX]

IDE:
Visual Studio for Mac 2019 (Preview 8.0 build 2624)

PKGS:
com.microsoft.dotnet.hostfxr.3.0.0-preview3-27503-5.component.osx.x64
com.microsoft.dotnet.sharedframework.Microsoft.NETCore.App.3.0.0-preview3-27503-5.component.osx.x64

Project:
netstandard 2.0 library

After install preview3, I'm unable to build any of my netstandard projects. All of them fails with following error:

/usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(5,5): Error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages' (13) due to: Could not resolve type with token 01000020 from typeref (expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly 'NuGet.Packaging, Version=5.0.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging, Version=5.0.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:NuGet.Packaging.Core.PackageIdentity member:(null)
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 (MSB4018)

For now, I tried to fix this error by removing all existing dotnet sdk versions by running this script. After that, I performed a reboot and reinstall preview3, same error.
The dotnet cli can build my projects with dotnet build, no errors, all fine.

@leecow
Copy link
Member

leecow commented Mar 15, 2019

Since you can build outside of VS for Mac using the CLI, I'm suspicious that it may be something on the VS for Mac side. Adding a few folks @livarcocc @sayedihashimi @mhutch ?

@sergiotapia
Copy link

On a simple dotnet new console -o MyApp, I can successfully:

dotnet build # for all three major platforms, Mac, Windows and Linux
dotnet run

But if I open the .csproj file in Visual Studio preview, I get build errors like OP.

@mhutch
Copy link
Member

mhutch commented Mar 26, 2019

/cc @mrward

@mrward
Copy link
Contributor

mrward commented Mar 26, 2019

.NET Core 3 preview 3 is not supported with Mono's MSBuild currently. .NET Core 3 preview 2 should be OK.

Mono's MSBuild is currently using NuGet v4 which does not support .NET Core 3 preview 3. NuGet v5 is needed.

https://developercommunity.visualstudio.com/content/problem/481018/resolvepackageassets-task-failed.html

@karelz
Copy link
Member

karelz commented Mar 30, 2019

Seems to be answered above. Closing.

@karelz karelz closed this as completed Mar 30, 2019
@sergiotapia
Copy link

So what is the solution here?

@vignatov
Copy link

vignatov commented Apr 1, 2019

I guess there is no solution. Only wait for the next MSBuild update and uninstall preview 3 till then if you need to compile.

@sergiotapia
Copy link

Thank you, just asking for would be travellers falling onto this Github issue. This issue should probably not be closed as it's not really fixed?

@karelz
Copy link
Member

karelz commented Apr 1, 2019

@sergiotapia please follow up with @mrward where to file the issue fo VS for Mac.

@mrward
Copy link
Contributor

mrward commented Apr 1, 2019

The issue is already filed on the Visual Studio for Mac's Developer Community - can you follow that to get updates? There should be a Follow button on the page.

https://developercommunity.visualstudio.com/content/problem/481018/resolvepackageassets-task-failed.html

knocte added a commit to nblockchain/geewallet that referenced this issue Apr 4, 2019
We're having a problem with a build suddenly failing[1], and the
only thing that could have changed recently is the .NET Core version.

There's a similar issue filed here[2] whose error is almost the same
as ours: [3]

[1] https://gitlab.com/DiginexGlobal/geewallet/pipelines/55116937
[2] dotnet/core#2460
[3] Error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/builds/DiginexGlobal/geewallet/src/GWallet.Backend.NetStandard/GWallet.Backend.NetStandard.fsproj]
/usr/share/dotnet/sdk/2.1.602/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages' (12) due to: Could not resolve type with token 01000025 from typeref (expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly 'NuGet.Packaging, Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging, Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:NuGet.Packaging.Core.PackageIdentity member:(null)
@knocte
Copy link

knocte commented Apr 4, 2019

The title of the issue should be tweaked, because it doesn't affect just .NET Core 3 anymore. I just reproduced it when my CI build pulled dotnet 2.1.602-1 (instead of 2.1.505-1 which was working fine yesterday). In my case the error is:

Error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/builds/DiginexGlobal/geewallet/src/GWallet.Backend.NetStandard/GWallet.Backend.NetStandard.fsproj]
/usr/share/dotnet/sdk/2.1.602/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(129,5): error MSB4018: System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages' (12) due to: Could not resolve type with token 01000025 from typeref (expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly 'NuGet.Packaging, Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging, Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:NuGet.Packaging.Core.PackageIdentity member:(null) 

I thought 2.1 was considered stable? Or is that 2.0? I'm confused.

@lytico
Copy link

lytico commented Apr 4, 2019

same here with dotnet 2.1.602-1
and linux ubuntu 18.04

@emmakun
Copy link

emmakun commented Apr 4, 2019

Same here with current dotnet 2.2.202 on MacOS Mojave 10.14.4 with Mono 5.18.1.3

@lytico
Copy link

lytico commented Apr 4, 2019

my theory:
Its a problem if monodevelop is installed on the same machine - maybe even mono, or some 4.0 Nuget.Packaging elsewhere
and they have updated NuGet.Packaging to Version=5.0.0.4, as seen in the traces
and, as known, monodevelop (aka visual studio mac) works with version 4.x.x
so somethere in the system msbuild finds the version 4.x.x. from monodevelop and ... bang!

@lytico
Copy link

lytico commented Apr 4, 2019

nothing worked on my system after the .net core - update last night
even the projects targeting the mono / .net framework didn't compile any more - all with the same error.
i completely removed all .net-core runtimes, sdks etc., deleted the directories manually (of course, uninstalling the .net core stuff left some slack everywhere), did: nuget locals all -clear
removed all references to .net-core projects in my solution
and now i can work at least with projects targeting mono/.net framework again.
what a mess!!!!!
AND THEY CLOSED THIS ISSUE!!! Why? nothing is solved!!!

@lytico
Copy link

lytico commented Apr 4, 2019

@alvaroemmanuel, @knocte
continue here:
#2540

@karelz
Copy link
Member

karelz commented Apr 5, 2019

@lytico the issue was closed because I thought the problem was answered - the scenario was unsupported. Nobody pushed back.
If you think there is a problem still existing, I recommend to describe clearly what is broken when (ideally calmly, exclamation marks won't help) - the new issue #2540 is still confusing and does not quite help me understand what exactly is broken in which situation, etc. Clear instructions and pointers and potential root causes usually speed up time to solution significantly.

@lytico
Copy link

lytico commented Apr 5, 2019

@karelz yes, i see, you closed the issue before the problems raised with .dotnetcore 2.1 and 2.2 too.
sorry for the exclamation marks

but its a really showstopper:

if you build projects with mono

and install dotnetcore 2.1.602

then you can't build projects any more

cause of this error

@gulando
Copy link

gulando commented Apr 6, 2019

I am using Ubuntu 18.04 and Jet Brains Rider.
My dot net version is 2.2.202
When I am trying to build my project I get same error related with "ResolvePackageDependencies" task failed unexpectedly.

@attababy
Copy link

Same Issue on ubuntu 18.04, dotnet core version 2.3.203

@jnm2
Copy link
Contributor

jnm2 commented May 5, 2019

@karelz This is a really confusing error. I finally figured out the workaround for now:

sudo apt-get install dotnet-sdk-2.2=2.2.105-1

It's also not obvious how to get from anywhere on https://dotnet.microsoft.com/download/dotnet-core/2.2 to the information needed to construct the terminal command above.

@karelz
Copy link
Member

karelz commented May 17, 2019

@jnm2 do you have suggestion what to change where? (in code or in docs?)

@jnm2
Copy link
Contributor

jnm2 commented May 17, 2019

This notification is good, but you could also mention MonoDevelop on Linux which has the exact same issue as VS for Mac:
image

Then when you click the link, it takes you here:
image

But the page at the Linux Package Manager Instructions: x64 doesn't actually explain how to get 2.2.107 which was the reason we followed these links in the first place.

It could say something to the effect of:

If you need to install 2.2.107 specifically, rather than the latest 2.2 release, use the following command:

sudo apt-get install dotnet-sdk-2.2=2.2.107-1

@karelz
Copy link
Member

karelz commented May 17, 2019

@leecow that sounds like reasonable request - can you please help make it happen?

@leecow
Copy link
Member

leecow commented May 20, 2019

Yes, I'll get with @rowanmiller to talk through how we might do cover this scenario.

@karelz
Copy link
Member

karelz commented Jun 5, 2019

@leecow @rowanmiller did it happen?

@leecow
Copy link
Member

leecow commented Jun 5, 2019

Sorry, no. Scheduling some time with Rowan now.

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