简体   繁体   English

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

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

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. 因此,我有一个Visual Studio解决方案,其中包括一个项目,该项目是依赖于某些NuGet程序包的库,以及一个依赖于该库的项目。 Whenever I build, it restores packages to the solution directory, and then tells me the library project can't find the NuGet packages. 每当我构建时,它都会将软件包还原到解决方案目录,然后告诉我图书馆项目找不到NuGet软件包。 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? 我如何让它们下载到项目目录,或告诉项目在解决方案目录中寻找NuGet软件包?

I'm using Visual Studio 2015, and the projects are both in C++ 我正在使用Visual Studio 2015,并且两个项目都在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

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

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

相关问题 将库与 NuGet 包链接为 Visual Studio 中的依赖项 - Linking Libraries with NuGet Packages as dependencies in Visual Studio 在没有 NuGet 的情况下将 gtest 添加到 Visual Studio 解决方案的最佳方法 - Best way to add gtest to Visual Studio solution without NuGet Caffe安装-缺少适用于OpenCv 2.4和OpenBlas 0.2.14的NuGet软件包-在Visual Studio 2015上引发一些生成错误 - Caffe Installation - NuGet packages for OpenCv 2.4 and OpenBlas 0.2.14 missing - throwing several build errors on Visual Studio 2015 从 Visual Studio 解决方案和项目(不是 cmake)中的非托管 (C++/C) 代码创建 Nuget 包 - Create Nuget package from unmanaged (C++/C) code in Visual Studio Solution and projects (not cmake) Visual Studio解决方案依赖性 - Visual Studio Solution Dependencies 在解决方案中的项目上使用时缺少NuGet软件包 - Missing NuGet packages when used on project within a solution Nuget C ++软件包充斥着我的解决方案 - Nuget C++ packages has flooded my solution with files 在CMake中包含Visual Studio解决方案 - Include Visual Studio solution in CMake Visual Studio 2015没有构建解决方案 - Visual Studio 2015 not building solution 具有多个项目的 Visual Studio 解决方案 - Visual studio solution with multiple projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM