NuGet Packages are missing
I searched this problem but none of the solutions worked. I have Visual Studio Professional 2015 installed and I am using TFS. My NuGet version is 3.1.6. This problem is happening only in my C# Web API/MVC project.
I am getting the below 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 ..packagesMicrosoft.Net.Compilers.1.0.0buildMicrosoft.Net.Compilers.props
I had the same error (missing exactly the same package) today. I also created a MVC + Web API project.
It happend because I moved the app files (including the .csproj) file to another location. I manually updated the .sln file but all packages dependencies are now (Visual Studio 2015) stored in .csproj file.
Editing the .csproj file and correcting the relative path to the solution folder (which contains the packages folder) solved the problem for me.
我通过从.csproj
文件中删除此代码解决了我的问题:
<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).nugetNuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir).nugetNuGet.targets'))" />
</Target>
If you have one more missing nuget package that giving your error while building your solution use following command using Nuget Command Console from Tools > Nuget Package Manager > Package Manager Console. It will reinstall your all current packages.
Update-Package –reinstall
BEWARE - this updates packages for the entire solution not just the project.
链接地址: http://www.djcxy.com/p/62282.html上一篇: Nuget恢复依赖项目
下一篇: NuGet包缺失