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 with .net core 2.1.602 #2540

Closed
lytico opened this issue Apr 4, 2019 · 39 comments
Closed

Build error GenerateDepFiles with .net core 2.1.602 #2540

lytico opened this issue Apr 4, 2019 · 39 comments

Comments

@lytico
Copy link

lytico commented Apr 4, 2019

Issue Title

after update to .net core 2.1.602, the following error occurs:

/usr/share/dotnet/sdk/2.1.602/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' (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)
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <4af592cdc6a44fea8da95cdd8712145c>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <58f0218f988743a48dd7c84cbe933f4e>:0 
  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) [0x001f6] in <58f0218f988743a48dd7c84cbe933f4e>:0  (MSB4018) (Limaki.UnitsOfWork.Core)

nothing worked on my system after the .net core - update last night
even the projects targeting the mono / .net framework dont't'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!!!!!

see also:
#2460 (comment)
#2460 (comment)

General

dotnet --info
.NET Core SDK (gemäß "global.json"):
Version: 2.1.602
Commit: 04475eb7cf

Laufzeitumgebung:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.602/

Host (useful for support):
Version: 2.1.9
Commit: dcedc87d22

.NET Core SDKs installed:
2.1.602 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

mono --version
Mono JIT compiler version 5.18.1.0 (tarball Fri Mar 15 20:41:32 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: preemptive
GC: sgen (concurrent by default)

=== MonoDevelop ===

Version 7.7 (build 1869)
Installation UUID: bde482dd-6fcb-4a4d-9bcc-e49461c3ecfe
GTK+ 2.24.32 (Adwaita theme)

=== Mono Framework MDK ===

Runtime:
Mono 5.18.1.0 (tarball Fri Mar 15 20:41:32 UTC 2019) (64-bit)

=== NuGet ===

Version: 4.7.0.5148

=== Build Information ===

Release ID: 707001869
Git revision: f0f3d1d931d44682f076dde486ecec835f705b8d
Build date: 2018-11-29 14:54:14-05

@lytico
Copy link
Author

lytico commented Apr 4, 2019

/usr/lib/mono/msbuild/15.0/bin/Roslyn/csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0 /errorendlocation /preferreduilang:en-US /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/mscorlib.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/netstandard.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.AppContext.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.Concurrent.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.NonGeneric.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Collections.Specialized.dll /reference:/home/user/.nuget/packages/system.componentmodel.annotations/4.5.0/ref/netstandard2.0/System.ComponentModel.Annotations.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.Composition.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Console.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Core.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Data.Common.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Data.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Contracts.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Debug.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Process.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Tools.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Diagnostics.Tracing.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Drawing.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Drawing.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Dynamic.Runtime.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.Calendars.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Globalization.Extensions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.IsolatedStorage.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.Pipes.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Expressions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Parallel.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Linq.Queryable.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Http.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.NameResolution.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.NetworkInformation.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Ping.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Requests.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Security.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.Sockets.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebSockets.Client.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Net.WebSockets.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Numerics.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ObjectModel.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.Extensions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Reflection.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.Reader.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.ResourceManager.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Resources.Writer.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Extensions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Handles.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.InteropServices.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Numerics.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Claims.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.Principal.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Security.SecureString.dll /reference:/home/user/.nuget/packages/system.servicemodel.primitives/4.5.3/ref/netstandard2.0/System.ServiceModel.dll /reference:/home/user/.nuget/packages/system.servicemodel.primitives/4.5.3/ref/netstandard2.0/System.ServiceModel.Primitives.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ServiceModel.Web.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.Encoding.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Text.RegularExpressions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Overlapped.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Tasks.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Thread.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.ThreadPool.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Threading.Timer.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Transactions.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.ValueTuple.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Web.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Windows.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.Linq.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.ReaderWriter.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.Serialization.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XDocument.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XmlDocument.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XmlSerializer.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XPath.dll /reference:/home/user/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll /debug+ /debug:portable /filealign:512 /optimize- /out:obj/Debug/netstandard2.0/Limaki.UnitsOfWork.Core.dll /target:library /warnaserror- /utf8output /deterministic+ /langversion:Latest

@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

@emmakun
Copy link

emmakun commented Apr 4, 2019

UPDATE: Downgraded net core from 2.2.202 to 2.2.104 and build started working again.

This seems to confirm the issue is directly caused by the latest dotnet update and not VS.

@lytico
Copy link
Author

lytico commented Apr 4, 2019

@alvaroemmanuel i agree with you.
if an update of one product destroys the functionality of another product, then one can't blame the destroyed product.
next update, and no mono stuff isn't running any more, or what?

@karelz
Copy link
Member

karelz commented Apr 5, 2019

I am a bit confused. Can someone please clarify with reasonable amount of detail - what happens after what?
What breaks after what kind of update? Is there a small repro? (HelloWorld style app ideally)
That will help us identify where to route it.

cc @mhutch

@lytico
Copy link
Author

lytico commented Apr 5, 2019

Sorry, no hello world possible.
I'll try:
You have a system. lets say a Linux Ubuntu 18.04 ( or ... MacOS Mojave 10.14.4, etc etc)
You have mono installed (latest available version for the system, eg. Mono 5.18.1.3)
You have monodevelop (aka Visual Studio Mac), eg. Version 7.7 (build 1869)
You have a project, doesn't matter what type:
eg. old-style
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
eg. new-style
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup><TargetFramework>net471</TargetFramework>
AND
you have .NET Core SDK installed, no matter 2.1 or 2.2, eg. 2.2.104
everything is fine, builds are running, even .dotnet core projects are compiling with monodevelop (aka Visual Studio Mac).

Then make your updates,, and you'll get Version: 2.1.602 or Version: 2.2.202 at the moment.
Then you get this
Error MSB4018: The "GenerateDepsFile" task failed
on all types of projects.

Steps to Reproduce (maybe:)

Take a clean installation of Ubuntu 18.04
Install mono, monodevelop
make your hello world, MAYBE also add reference to a .netstandard-project (I have no projects without that, so i didn't try that)
everything works fine

Then: Install dotnetcore Version: 2.1.602 or Version: 2.2.202

you will not be able to build your projects anymore, neither with monodevelop nor with msbuild.

if you downgrade to eg. dotnetcore 2.2.104 , everything is fine again.

hope it helped

@nvankesteren
Copy link

nvankesteren commented Apr 5, 2019

I have the same problem. Had a Xamarin.Forms project in VS2017 for Mac. Updated to the latest .NET Core 2.2.202 last week, but I failed to check if it compiled. Yesterday I installed VS2019 for Mac and I get the same error building my project.

So I decided to create a new project based on the Xamarin.Forms template project. That throws the same error. So hopefully you can repro that...

@igorgiovannini
Copy link

igorgiovannini commented Apr 5, 2019

Same problem here...
Downgrading to .NET Core @ 2.2.105 fixed the problem.
macOS 10.14.4, .NET Core SDK: 2.2.202

Project 'BLL.Tests' load finished with warnings The "ResolvePackageDependencies" task failed unexpectedly. System.TypeLoadException: Could not resolve type with token 01000035 from typeref (expected class 'NuGet.Packaging.Core.PackageDependency' in assembly 'NuGet.Packaging, Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35')

@nvankesteren
Copy link

Yes, that fixed it for my template project and regular project as well.

@lytico
Copy link
Author

lytico commented Apr 8, 2019

same problem with rider on ubuntu 18.04

@lytico
Copy link
Author

lytico commented Apr 8, 2019

seems this error is discussed here too:
NuGet/Home#7956

@Huck
Copy link

Huck commented Apr 11, 2019

Been having the exact same issue for a week now on Ubuntu 18.04. Is there any fix in sight? downgraded to 105 for now but we can't stay on a stale version for ever.

Does anybody have a solution? thanks

@daerogami
Copy link

Same issue. Using Linux Mint 19.1
Tried using Monodevelop, VSCode and MSBuild from the CLI. Same issue everytime with both core 2.1 and 2.2 versions from apt repo

Not even sure how to get to the older build versions mentioned above.

TheMofaDe added a commit to TheMofaDe/DotNetHelper-IO that referenced this issue Apr 15, 2019
zakaluka pushed a commit to zakaluka/IfSharp that referenced this issue Apr 21, 2019
Signed-off-by: Sachin Shah <zakaff@gmail.com>
cgravill pushed a commit to fsprojects/IfSharp that referenced this issue Apr 21, 2019
* Jupyter extensions in Docker image

Adds Jupyter extension to Docker image for #199

* Docker update for dotnet/core#2540

Signed-off-by: Sachin Shah <zakaff@gmail.com>
@thiagojedi
Copy link

thiagojedi commented Apr 24, 2019

Not even sure how to get to the older build versions mentioned above.

@daerogami Try: sudo apt install dotnet-sdk-2.2=2.2.105-1

@jkoritzinsky
Copy link
Member

This is also reproducing with the following version combination:

Mono JIT compiler version 5.12.0.301 (2018-02/4fe3280bba1 Fri Jul 20 08:25:42 EDT 2018)
Microsoft (R) Build Engine version 15.7.224.30163 (xplat-master/d375bb6e Sat Jun 30 05:26:28 EDT 2018) for Mono
15.7.224.30163.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview4-011223

@jkoritzinsky
Copy link
Member

Link to an Azure DevOps build with a consistent repro: https://dev.azure.com/dotnet/IronLanguages/_build/results?buildId=16441

@lytico
Copy link
Author

lytico commented May 16, 2019

same error with update to .net core 2.1.604 , nothing changed

@aphex3k
Copy link

aphex3k commented May 17, 2019

I update .NET SDK to 2.2.203 and .NET Core to 2.2.4 and the issue resolved for me...

@karelz
Copy link
Member

karelz commented May 17, 2019

@jkoritzinsky can you please help me understand what is wrong where and who should take care of it?
I am unable to parse the info here to route it :(

@jkoritzinsky
Copy link
Member

@karelz I followed the chain down through the various referenced issues and ended up finding the solution for my case by following this chain:

NuGet/Home#7956
https://developercommunity.visualstudio.com/content/problem/481018/resolvepackageassets-task-failed.html

and then to the internal ticket.

Looks like a combination of a .NET SDK that uses NuGet 5 and a VS for Mac or MonoDevelop that uses NuGet 4 causes a weird type-load issue since NuGet moved a type in 5 and didn't correctly add a type forward.

Based on the versions, it seems to be the VS for Mac side of dotnet/sdk#3124. The next version of VS for Mac should fix it.

@karelz
Copy link
Member

karelz commented May 17, 2019

OK, nothing left to track here then. Thanks @jkoritzinsky! (and I really hope I did not misunderstand your reply :))

@beeradmoore
Copy link

I just had this issue this morning after installing 2.1.603 so I can compile for 2.1.10 for AWS Lambda functions. Found a solution online which was to upgrade to VS for Mac 8.1 preview 2. That worked until VS for Mac started crashing. Reinstalled VS for Mac stable (8.0.9) I noticed it installed 2.1.506. Build fails. Uninstalled 2.1.603, build now works.

I don't get what the difference is between 506 and 603, why they were both released not the same day, and why 603 does things with nuget 5. But at least I am able to work again.

@karelz
Copy link
Member

karelz commented Jun 5, 2019

506 and 603 target different VS version: https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1.603-SDK/2.1.603-SDK-download.md

@beeradmoore
Copy link

Ah yep, that makes sense @karelz. When I was looking at the download page 506 says it supports Visual Studio 2017 (v15.9) and 603 says it supports Visual Studio 2017 (v16). I now realise that VS for Mac is neither of these. I'll be sure to dig around more in the release notes in future to be sure I get the correct version.

@ststeiger
Copy link

ststeiger commented Jul 10, 2019

Fails as well for mono 5.20.1.19 and dotnet 2.2.203 on Ubuntu 19.04, with MonoDevelop and Rider.
For reproduction, try to clone and compile this on Linux.
Sadly, it works perfectly on Windows.
Happens as soon as you add HtmlAgilityPack to the project (in sub-project GeoAPIs).
Opened issue 314 on HtmlAgilityPack as well.

/root/.dotnet/sdk/2.2.203/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' (12) due to: Could not resolve type with token 01000027 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)
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <c5e0e1dbe29a4fae9ad829d4b52ccc8b>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <58f0218f988743a48dd7c84cbe933f4e>:0 
  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) [0x001f6] in <58f0218f988743a48dd7c84cbe933f4e>:0  (MSB4018) (GeoApis)

@AndreyAkinshin
Copy link
Member

Here is a help article which explains the problem, lists all incompatible configurations, and shows possible ways to resolve the problem: https://rider-support.jetbrains.com/hc/en-us/articles/360004180039

@ststeiger in Rider, you should get a notification which redirects you to this article.

@ststeiger
Copy link

@AndreyAkinshin: Just checked: not in 2019.1.1, but updated to 2019.2, and there, yes.

Solved, built mono 6 from source.

@knocte
Copy link

knocte commented Jul 11, 2019

Just checked: not in 2019.1.1, but updated to 2019.2

What's 2019.1.1 and 2019.2?

Solved, built mono 6 from source.

Are you saying that mono version 6.x doesn't have this bug? If yes, can you try with packages instead of building from source? In NuGet/Home#7956 (comment) we determined that this is caused by the version of nuget being bundled.

@AndreyAkinshin
Copy link
Member

@knocte

What's 2019.1.1 and 2019.2?

It's versions of Rider. In Rider 2019.2, we significantly improved our diagnostics: once you hit this problem, Rider will notify you about it and tell you how to fix it. Rider 2019.1 also knows how to detect this problem, but it doesn't cover all the possible misconfiguration cases.

Are you saying that mono version 6.x doesn't have this bug?

Actually, it's not a bug, it's an incompatible configuration. Mono 5.x uses NuGet 4.x; Mono 6.x uses NuGet 5.x. So, Mono 5.x is compatible with versions of .NET Core SDK that use NuGet 4.x (e.g., 2.1.505 or 2.2.108), and Mono 6.x is compatible with versions of .NET Core SDK that use NuGet 5.x (e.g., 3.0.100-preview6).

You can find all the details (including the list of bundled NuGet in each version of Mono and .NET Core SDK) in this help article: https://rider-support.jetbrains.com/hc/en-us/articles/360004180039

@knocte
Copy link

knocte commented Jul 11, 2019

Actually, it's not a bug, it's an incompatible configuration

I disagree. Even if you identified what dotnetCore versions are compatible with what mono versions, it's not acceptable that both versions that are considered stable at this moment are incompatible (preview being incompatible with stable would be more understandable).

@ststeiger
Copy link

ststeiger commented Jul 11, 2019

@AndreyAkinshin:
Hmm, that was too soon.
Built mono 6 from source, mono --version shows 6.5, but the problem persists.

I've now also entirely removed the HtmlAgilityPack nuget package, and added it as netstandard 2.0 project, but the problem persists now. Hmmm, somehow, it seems like the project file is screwed up now.

Hmm, it's not that either.

@ststeiger
Copy link

ststeiger commented Jul 11, 2019

@AndreyAkinshin:
Ah, got it, autodetect is only detecting msbuild in /usr/lib/mono, and not not /usr/local/lib/mono.

Why can this setting not be set on a per-project base ?
Is msbuild building per solution or per project ?

@AndreyAkinshin
Copy link
Member

@ststeiger

Ah, got it, autodetect is only detecting msbuild in /usr/lib/mono, and not not /usr/local/lib/mono.
It's strange. I guess we have to improve the autodetect logic. Could you please tell me what kind of Linux do you use?

Why can this setting not be set on a per-project base ?

In Rider, you can save this settings per solution (personal or team-shared) or per machine:
image

We do not support per-project MSBuild toolsets because it will be impossible to process project reference with such a configuration.

@ststeiger
Copy link

ststeiger commented Jul 15, 2019

@AndreyAkinshin:

It's strange. I guess we have to improve the autodetect logic. Could you please tell me what kind of Linux do you use?

kUbuntu, 19.04 (disco dingo)

It might have something todo with that /usr/lib/mono/msbuild contains subfolders like 15.0
while /usr/local/lib/mono/msbuild only contains subfolder "current", no version number.

That is, assuming Rider's autodetect lists folders and expects numbers to auto-detect.

We do not support per-project MSBuild toolsets because it will be impossible to process project reference with such a configuration.

Ah, I see.
But I can have a full .net framework project, and a .net core project in the same solution.

Anyway, for the moment I'm satisfied if I can manually change that per solution.

@AndreyAkinshin
Copy link
Member

@ststeiger thanks for the feedback! I created the corresponding issue: https://youtrack.jetbrains.com/issue/RIDER-30143

@hiradyazdan
Copy link

@AndreyAkinshin I am having the same issue on Rider 2019.2 on OSX while having Mono 6.0 (rider auto detects msbuild 15 as latest). I also get the same build error while using msbuild 16 in command line.

@hiradyazdan
Copy link

hiradyazdan commented Sep 21, 2019

just installed latest .Net Core SDK (v2.2.402) and build succeeds.

Note that If also want to build .net framework with Rider, need to use MSBuild version 15, and not 16, as it throws compile errors.

@krishnarajbb
Copy link

I had .net standard project built on .net standard 2.0. Yesterday I updated my Visual Studio 2019 to 16.3.0 to leverage .Net Core 3.0. But all of sudden build of project targeting on standard 2.0 started throwing "GenerateDepsFile" task failed unexpectedly error.

I was able to resolve this issue by changing the target framework to 2.1.

@Levris
Copy link

Levris commented Jun 2, 2020

Heave same error and find -" C:\Microsoft\Xamarin" folder has changed security rules and i heave no right to this folder. Change rights and all works !

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