Search code examples
msbuildazure-devopsnugetazure-devops-self-hosted-agent

msbuild GenerateDepsFile fails


All my projects are not failing to build on my Azure DevOps MacOS build host. It's a self-hosted build host. Suddenly, my projects are throwing this error when trying to build:

error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()

I found this GitHub issue which seemed similar, but the posted solution didn't help me: https://github.com/mono/mono/issues/13537

As mentioned in xamarin/xamarin-android#3155 this is caused by a version mismatch in nuget between msbuild and dotnet core. The solution is to update your dotnet core install to the latest stable version

I've installed the most recent .NET Core, and updated Visual Studio for Mac, but alas, the problem remains.

Another information: When I build the same Xamarin.iOS project from my Windows machine coupled with the same MacOS build host, the app builds just fine. But I am guessing the process is probably different.


Solution

  • Updating both Visual Studio for Mac and .NET Core SDK again today seems to have fixed the problem.