C# xamarin git pull nuget包错误

C# xamarin git pull nuget包错误,c#,git,visual-studio,xamarin,nuget,C#,Git,Visual Studio,Xamarin,Nuget,我是Xamarin android开发的新手 我从git获取代码 之后,我在VisualStudio中打开了我的解决方案 我清洗了溶液-现在好了 然后我尝试构建解决方案,它显示了错误 >Restoring NuGet packages... To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager nod

我是Xamarin android开发的新手

我从git获取代码

之后,我在VisualStudio中打开了我的解决方案

我清洗了溶液-现在好了

然后我尝试构建解决方案,它显示了错误

>Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
NuGet Package restore failed for project app: Unable to find version '2.0.0' of package 'FastAndroidCamera'.
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'FastAndroidCamera.2.0.0' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
  https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
  An error occurred while sending the request.
  The remote name could not be resolved: 'api.nuget.org'
1>------ Rebuild All started: Project: app, Configuration: Debug Any CPU ------
1>D:\PRANAV\TOLL\GIT\MobileApp-12-06-2018\MobileApp\app\app.csproj(467,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.props.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========\

这就是我得到的错误。伙计们,你们能猜出我在哪里出错吗?

根据错误信息

要防止NuGet在生成期间还原包,请打开 在“Studio选项”对话框中,单击“包管理器”节点并取消选中 '允许NuGet在生成过程中下载丢失的包。'

该项目似乎使用了现在已弃用的旧NuGet包还原,该还原基于MSBuild,并在每个生成上运行
NuGet.exe
。这些消息来自
NuGet.exe

检查类似问题

要解决此问题,应确保升级到最新版本的NuGet,该版本会自动执行包还原,而不是基于MSBuild的NuGet包还原

您将要删除NuGet目标(删除
.NuGet
文件夹,然后手动编辑
.csproj
文件并删除导入
NuGet.targets
文件的行)。这已不再需要。使用新的恢复nuget包的方法,Visual Studio将在生成之前自动恢复nuget包

有关更多信息,请参阅David Ebbo的这篇文章:以及博客


希望这能有所帮助。

看起来NuGet无法解析api.NuGet.org。您是否尝试重新启动Visual Studio并能够访问?完成,但出现相同错误\n我尝试还原nuget,但出现相同问题..并再次检查,运行Visual Studio的计算机是否已连接到internet并能够访问?我尝试在浏览器上运行此操作,我得到一个json