I have just converted a PCL in a Xamarin.Forms (XF) solution to NetStandard 2.0. Everything builds fine in Visual Studio 2017 and Visual Studio for Mac.
I also have a Jenkins pipeline on a Mac, which before the conversion ran without any problems. The individual projects of the solution are built with Mono MSBuild version 15.4.0.0 (/Library/Frameworks/Mono.framework/Commands/msbuild). Now I get the following error when building the new NetStandard library in Jenkins:
error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0
The above error is shown when compiling each of the view models.
Two interesting points:
- I do not get the error when I use msbuild from the command line to build the project in a different directory (outside Jenkins).
- I do get the error when I build the project on the command line in the Jenkins directory (/Users/Shared/Jenkins/Home/workspace/project name) as root, but if I run it again, it builds without errors!
Any idea what could be the problem here?