2012-07-02 43 views
9

我試圖讓NuGet在單聲道2.10.9(Mac)上運行,但沒有運氣。如何在Mono 2.10.9上運行NuGet?

我想從的NuGet庫安裝南希:

mono --runtime=v4.0 /usr/local/bin/NuGet.exe install Nancy -Version 0.11.0 

但是,最終與此錯誤消息:

Missing method System.Security.Cryptography.CryptoConfig::get_AllowOnlyFipsAlgorithms() in assembly /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/mscorlib.dll, referenced in assembly /usr/local/bin/NuGet.exe 
Method not found: 'System.Security.Cryptography.CryptoConfig.get_AllowOnlyFipsAlgorithms'. 

我可以列出庫沒有問題。

mono --runtime=v4.0 /usr/local/bin/NuGet.exe list Nancy 

我試圖將Microsoft.Build.dll添加到與NuGet.exe相同的路徑(我不記得在哪裏)。

我結束了這個錯誤:

Invalid type Microsoft.Build.Evaluation.Project for instance field NuGet.Common.MSBuildProjectSystem:<Project>k__BackingField 
Could not load type 'NuGet.Common.MSBuildProjectSystem' from assembly 'NuGet, Version=2.0.30619.9000, Culture=neutral, PublicKeyToken=null'. 

我如何能得到NuGet.exe在Mono(蘋果機)上運行有什麼建議?

回答

8

恐怕你不能用你安裝的Mono版本來做到這一點。 特定版本(2.10.9)不包括靜態屬性:

System.Security.Cryptography.CryptoConfig.AllowOnlyFipsAlgorithms 

這似乎是由NuGet.exe需要「安裝」功能。 「list」命令可能起作用,因爲它沒有使用加密程序集(在.NET程序集中是延遲加載的,只有當執行代碼需要它們時)。

從積極的方面,這似乎是在單GitHub的版本CryptoConfig類與這個屬性更新,你可以在這裏看到:

Current mono CryptoConfig.cs source, on master branch

這顯示了變化應該被列入在2.10.9版本:

History of changes on mono's CryptoConfig.cs

的AllowOnlyFipsAlgorithms 5月2日2011年,加入了整整一年以前的財產,但它不是在當前穩定發佈!!! 這是奇怪的...

你可以嘗試下載alpha版本(單聲道2.11.2),看看你做了什麼。

P.S. 我已經查看了2.11.2 alpha版本的源代碼,它看起來像這個屬性包含在這個版本中,所以試試看。 希望這有助於。

相關問題