【发布时间】:2018-09-20 19:04:51
【问题描述】:
我正在尝试使用 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 构建机器上使用我的帐户成功构建项目,但 Jenkins 服务帐户在这里总是失败。我已经尝试清除和恢复所有 NuGet 包,但 MSBuild 日志并没有太大帮助,尽管使用 Jenkins 运行时 MSBuild 加载的程序集似乎比我运行时少得多。
这是我的项目设置方式的问题,还是 Jenkins 的问题?
【问题讨论】:
-
使用运行 jenkins 构建的同一用户,您可以使用自己的命令行构建项目吗?
-
@gunr2171 运行 Jenkins 构建的用户是服务帐户,所以很遗憾我无法登录。
-
您正在为构建运行什么命令?
msbuild还是dotnet?您是否安装了 .net 核心运行时? -
@gunr2171 我运行
msbuild BlipBlop.sln /p:Configuration=Ad-Hoc /p:Platform=iphone /p:Buildipa=true。解决方案中仅有的两个项目是 .NET Standard 项目和 iOS 项目。 .NET core 2.1.302根据dotnet --version命令安装。
标签: c# ios xamarin jenkins msbuild