C# Jenkins无法在缺少对assembly netstandard的引用的情况下构建Xamarin iOS项目

C# Jenkins无法在缺少对assembly netstandard的引用的情况下构建Xamarin iOS项目,c#,ios,xamarin,jenkins,msbuild,C#,Ios,Xamarin,Jenkins,Msbuild,我正在尝试使用Jenkins为Xamarin iOS项目构建CI管道,但在MSBuild未找到对.NET标准库的引用时遇到错误: 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,

我正在尝试使用Jenkins为Xamarin iOS项目构建CI管道,但在MSBuild未找到对.NET标准库的引用时遇到错误:

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'.
我可以在Mac build机器上成功地在我的帐户上构建项目,但是Jenkins服务帐户在这里总是失败。我已尝试清除和恢复所有NuGet包,而MSBuild日志没有多大帮助,尽管与Jenkins一起运行时,MSBuild加载的程序集似乎比由我运行时少得多


这是我的项目如何设置的问题,还是Jenkins的问题

结果是Jenkins帐户上的
PATH
环境变量缺少
/usr/local/share/dotnet
路径,因此无法访问NuGetFallbackFolder(NETStandard.Library引用所在的位置)


/usr/local/share/dotnet
添加到
路径
修复了构建。

结果是,Jenkins帐户上的
路径
环境变量缺少
/usr/local/share/dotnet
路径,无法访问NuGetFallbackFolder(NETStandard.Library引用所在的位置)


/usr/local/share/dotnet
添加到
PATH
修复了构建。

像我添加的那样添加$PATH

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

像我添加的那样添加$Path

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

对于运行jenkins build的同一用户,您是否能够使用自己的命令行来构建项目?@gunr217运行jenkins build的用户是一个服务帐户,因此很遗憾,我无法登录到该帐户。您为构建运行的是什么命令
msbuild
dotnet
?您是否安装了.net core运行时?@gunr2171我运行
msbuild BlipBlop.sln/p:Configuration=Ad Hoc/p:Platform=iphone/p:Buildipa=true
。解决方案中仅有的两个项目是.NET标准项目和iOS项目。NET core 2.1.302是根据
dotnet--version
命令安装的。使用运行jenkins build的同一用户,您是否能够使用自己的命令行构建项目?@gunr217运行jenkins build的用户是一个服务帐户,很遗憾,我无法登录到它。您正在为构建运行什么命令
msbuild
dotnet
?您是否安装了.net core运行时?@gunr2171我运行
msbuild BlipBlop.sln/p:Configuration=Ad Hoc/p:Platform=iphone/p:Buildipa=true
。解决方案中仅有的两个项目是.NET标准项目和iOS项目。NET core 2.1.302是根据
dotnet--version
命令安装的。如果你们在jenkins需要任何帮助,请告诉我。我知道这对初学者来说很难。如果你们在詹金斯需要任何帮助,请告诉我。我知道对初学者来说很难。