Allan R.
Allan R.

Reputation: 76

Jenkins cannot build Xamarin iOS project over a missing reference to assembly netstandard

I'm trying to build a CI pipeline for a Xamarin iOS project with Jenkins, but I'm running into errors with MSBuild not finding a reference to the .NET Standard library:

IDebugSettingService.cs(8,22): error CS0012: The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
ViewModels/IPresentationTabViewModel.cs(17,15): error CS0012: The type 'MulticastDelegate' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
ViewModels/ICredentials.cs(17,10): error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

I can build the project successfully on my account on the Mac build machine, but the Jenkins service account always fails here. I've tried clearing and restoring all the NuGet packages, and the MSBuild logs aren't much help, although MSBuild seems to load significantly less assemblies when run with Jenkins than when run by me.

Is this a problem with how my project is set up, or is it a problem with Jenkins?

Upvotes: 0

Views: 289

Answers (2)

Zumry Mohamed
Zumry Mohamed

Reputation: 9558

Add $Path like i have added

Path=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$Path:/usr/local/share/dotnet

enter image description here

Upvotes: 1

Allan R.
Allan R.

Reputation: 76

It turns out the PATH environment variable on the Jenkins account was missing the /usr/local/share/dotnet path and couldn't access NuGetFallbackFolder (where the NETStandard.Library reference is located) as a result.

Adding /usr/local/share/dotnet to PATH fixed the build.

Upvotes: 1

Related Questions