gpt4 book ai didi

c++ - Visual Studio 未找到与解决方案相关的 NuGet 包

转载 作者:行者123 更新时间:2023-11-30 03:34:54 25 4
gpt4 key购买 nike

所以我有一个 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/来解决这个问题

关于c++ - Visual Studio 未找到与解决方案相关的 NuGet 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41654819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com