簡體   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