繁体   English   中英

Visual Studio找不到相对于解决方案的NuGet软件包

[英]Visual Studio not finding NuGet packages relative to solution

因此,我有一个Visual Studio解决方案,其中包括一个项目,该项目是依赖于某些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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM