Reputation: 311
I tried to run .Net Core application in Visual Studio Mac. DB migration worked successfully. But the following error is popping up. Can anyone help me to solve this.
/usr/local/share/dotnet/sdk/2.2.401/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.2.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging, Version=5.2.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:NuGet.Packaging.Core.PackageIdentity member:(null) at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <73c82f66c8c94b8d8d3314a5e98a0984>: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) [0x001f6] 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) (Ammboo.Core.Infrastructure)
Thanks in Advance
Upvotes: 0
Views: 1170
Reputation: 47967
Your Mono and Visual Studio for Mac version do not support the versions of the .NET Core SDK you are trying to use.
Mono 5.18.1.3 only supports .NET Core 2.1.507, or earlier versions, or .NET Core 2.2.108 or earlier.
Later .NET Core sdk versions are not supported due to incompatibilities between NuGet versions.
You will have to uninstall the newer SDK versions. Visual Studio for Mac 8.0 does not support using a global.json to use a specific SDK version.
Upvotes: 0