Visual Studio没有找到相对于解决方案的NuGet包

时间:2017-01-14 20:45:10

标签: c++ visual-studio visual-studio-2015 nuget

所以我有一个可视化工作室解决方案,其中包括一个项目,该项目是依赖于某些NuGet包的库,以及依赖于库的项目。每当我构建时,它都会将包恢复到解决方案目录,然后告诉我库项目无法找到NuGet包。如何让他们下载到项目目录,或者告诉项目在解决方案目录中查找NuGet包?

我正在使用Visual Studio 2015,项目都是C ++

这是它显示的错误:

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 finished.
1>------ Build started: Project: GameLibrary, Configuration: Debug x64 ------
1>Build started 1/14/2017 3:44:05 PM.
1>     1>
1>C:\Users\luis\Documents\Visual Studio 2015\Projects\TheGameOfGames\external\GameLibrary\projects\visualstudio\GameLibrary.vcxproj(345,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\libjpeg.redist.9.0.1.4\build\native\libjpeg.redist.targets.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.20

1 个答案:

答案 0 :(得分:2)

所以我设法通过在notepad ++中编辑库vcxproj并将所有以packages /开头的包的引用更改为$(SolutionDir)packages /

来解决这个问题。