Reputation: 375
So I have a visual studio solution that includes a project that is a library which depends on some NuGet package, and a project that depends on the library. Whenever I build, it restores packages to the solution directory, and then tells me the library project can't find the NuGet packages. How do I either get them to download to the project directory, or tell the project to look for the NuGet packages in the solution directory?
I'm using Visual Studio 2015, and the projects are both in C++
Here's the error it shows:
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
Upvotes: 1
Views: 991
Reputation: 375
SO I managed to fix this by editing the library vcxproj in notepad++ and changing all references of packages starting with packages/ to $(SolutionDir)packages/
Upvotes: 2