我在Visual Studio中为我的项目启用了自动还原功能,但当我切换到MAC和Xamarin Studio时,我无法恢复这些包:
xxx.csproj: 错误:该项目引用了在此计算机上缺失的NuGet包。启用NuGet包还原以下载它们。
xxx.csproj: 错误:该项目引用了在此计算机上缺失的NuGet包。启用NuGet包还原以下载它们。
我假设你所说的“启用自动还原功能”是指基于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>
您也可以通过在 Xamarin-Studio 或 Visual-Studio 中右键单击解决方案并选择还原包来手动还原。