2016-11-20 133 views
1

拉出一些代碼更新後,我發現我在構建時收到了此消息。某些NuGet包在Visual Studio應用程序中的解決方案中缺失

Some NuGet packages are missing from the solution. 
The packages need to be restored in order to build the dependency graph. 
Restore the packages before performing any operations 

在Solution Explorer與丟失的引用圖標

顯示的引用鏈接我刪除了參考文獻,然後在包管理器控制檯的按鈕出現,問我是否想安裝缺少的包。但是,這並沒有奏效。

+1

右鍵單擊解決方案,恢復Nuget包。 – user3185569

+0

只需在NuGet命令行中鍵入restore? – Fang

+0

哎呀,我是右鍵點擊該項目。當我右鍵點擊解決方案時,該選項可用。 –

回答

0

當我嘗試在解決方案之外自行打開項目並構建它時,我收到了該消息。

"One or more NuGet packages need to be restored but couldn't be because consent has not been granted. To give consent, open the Visual Studio Options dialog, click on the Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'. " 

我授予VS權限,然後我跑在包管理器控制檯

update-package -Reinstall 
+1

感謝您分享您的答案。請標記您的答案,這對有相同問題的其他社區有益。 –

1

TT的可能是第一次下載過程中文件夾/拉鍊內容錯誤所以去Xamarin文件夾(C:/ User/YourName/AppData/Local/Xamarin)刪除或重命名或移出丟失的nuget文件夾或zips文件夾的內容。重新啓動IDE,您的IDE再次下載內容。我試試這個,它的工作。

+0

我沒有使用xamarin –

1

點擊Ctrl + Q並編寫丟失包的名稱,然後單擊搜索在線NuGet包匹配。 它會顯示菜單點擊瀏覽,會給你缺少的軟件包點擊安裝,卸載或更新。 enter image description here

相關問題