Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# NuGet软件包在visual studio 2015和Xamarin中引发问题_C#_Android_Nuget_Visual Studio 2015_Nuget Package - Fatal编程技术网

C# NuGet软件包在visual studio 2015和Xamarin中引发问题

C# NuGet软件包在visual studio 2015和Xamarin中引发问题,c#,android,nuget,visual-studio-2015,nuget-package,C#,Android,Nuget,Visual Studio 2015,Nuget Package,我正试图与另一位具有源代码管理的朋友一起使用Xamarin和Visual Studio 2015创建一个android应用程序 一切都很顺利,直到我的朋友添加了一个项目,并使用了NuGet软件包 激活“获取最新版本”并尝试构建解决方案后,我收到错误消息: Severity Code Description Project File Line Error This project references NuGet package(s) that are missing

我正试图与另一位具有源代码管理的朋友一起使用Xamarin和Visual Studio 2015创建一个android应用程序

一切都很顺利,直到我的朋友添加了一个项目,并使用了NuGet软件包

激活“获取最新版本”并尝试构建解决方案后,我收到错误消息:

Severity    Code    Description Project File    Line
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\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props.    iBuy.API    C:\Users\איציק\Source\Workspaces\iBuy\IBuy\iBuy.API\iBuy.API.csproj 164
我查找了一些解决此问题的方法,试图卸载Microsoft.CodeDom.Providers.DotNetCompilerPlatform和Microsoft.Net.Compilers软件包并重新安装它们,但没有任何帮助。 我的解决方案中甚至没有\packages\Microsoft.Net.Compilers.1.0.0\build文件夹

NuGet包还原中的所有内容都已检查,我的解决方案中没有任何“.NuGet”文件

我该怎么做才能消除该错误消息


提前谢谢你

将出现该错误消息,因为您没有.nuget\nuget.targets文件

要修复此问题,可以停止使用基于MSBuild的NuGet包还原,或将.NuGet/NuGet.targets文件添加到源代码管理中

NuGet团队不推荐使用基于MSBuild的NuGet包还原。它会向项目文件(.csproj)中添加一些额外的元素:


此项目引用此计算机上缺少的NuGet包。启用NuGet软件包还原以下载它们。有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkID=322105. 缺少的文件是{0}。

在EnsureNuggetPackageBuildImports目标元素中可能有更多项。您可以从项目文件中删除这些文件,转而依赖Visual Studio来恢复NuGet软件包。

拥抱和亲吻您。
<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>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />