![](/img/trans.png)
[英]Missing netstandard 2.0 assembly error on blank Xamarin.Forms project
[英]Jenkins cannot build Xamarin iOS project over a missing reference to assembly netstandard
我正在嘗試使用Jenkins為Xamarin iOS項目構建CI管道,但是我遇到了MSBuild的錯誤,找不到對.NET Standard庫的引用:
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軟件包,盡管與Jenkins一起運行時,MSBuild加載的程序集似乎比我自己運行時要少得多,但MSBuild日志並沒有太大幫助。
這是我的項目如何設置的問題,還是Jenkins的問題?
事實證明,Jenkins帳戶上的PATH
環境變量缺少/usr/local/share/dotnet
路徑,因此無法訪問NuGetFallbackFolder(位於NETStandard.Library引用所在的位置)。
將/usr/local/share/dotnet
到PATH
修復構建。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.