2014-04-12 100 views

回答

4

通過啓用自動恢復功能我假設您指的是基於MSBuild的恢復,它將NuGet.targets文件添加到您的項目。

特定誤差是從的MSBuild文件來:

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 
    <PropertyGroup> 
     <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> 
    </PropertyGroup> 
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" /> 
    </Target> 

錯誤情況表明,它無法找到.nuget \ NuGet.targets文件。這是否存在?路徑的情況是否完全匹配?

另請注意,Mac上的NuGet.targets文件存在問題,因爲它使用了Mono上不支持的MSBuild功能。從codeplex可用的最新NuGet.targets文件可能會解決此問題。

刪除基於MSBuild的軟件包恢復並安裝NuGet addin for Xamarin Studio並使用Xamarin Studio內的軟件包恢復功能可能更容易。要從Xamarin Studio中恢復,您可以右鍵單擊該項目並選擇恢復軟件包。

+0

我正在從Visual Studio(開發代碼)和Xamarin Studio(在MAC下)開發xib接口的同一個GIT存儲庫。我沒有在GIT repo下保存nuget包,我想在Xamarin Studio(MAC)下自動恢復它,一旦我在Visual Studio下添加了一些引用。 –

+0

@Matt Ward:這是哪個MSBuild功能?如果這不是太困難,那麼也許我們可以實施它。如果我們能夠獲得一些命令行版本,那將是很酷的。 –

+0

@MartinBaulig - 我相信這是Choose元素的問題 - https://bugzilla.xamarin.com/show_bug.cgi?id=18106 –

0

您也可以通過右擊解決方案,然後選擇恢復Xamarin-Studio或Visual-Studio中的軟件包手動恢復。

相關問題