NuGet Package restore IS enabled but I get an error saying it's not enabled

无人久伴 提交于 2019-12-12 08:30:06

问题


I have nuget package restore enabled in my solution. However, when I try to build the project, I get this error:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.

Any ideas how to fix this problem?

I have tried deleting my NuGet.targets and NuGet.exe file and re-enabling nugget package restore. It recreates the files and I get the same error.


回答1:


Try and see if this helps:

in solution explorer, right click on the project name and select 'Enable Nudget package restore'

also remember to rebuild each of your projects

wait until it gets restored and run the project if it works fine




回答2:


Please follow below mentioned steps:

Step 1: Please enable Nuget Package Restore by right clicking on solution [as mentioned in below screenshot]

Step 2: [Follow this if the issue / error is not resolved by following step 1] Still if you face the issue, please open .csproj file in notepad and check for the package path which might look like

So your solutions directory structure will be like: \SolutionDirectory\

Package Directory \SolutionDirectory\packages

Project Directory \SolutionDirectory\ProjectName\ProjectName.csproj

Please open this .csproj [in which you're getting error in notepad and search for packages path and update it to its relevant path.

For e.g. my .csproj contained, if .csproj file contains ....\packages then update that path with ..\packages




回答3:


I had already done what the blog post recommends (through the options menu) and it still didn't build.

In the end I removed the Microsoft.Net.Http Nuget Package and Reinstalled it and that fixed it.



来源:https://stackoverflow.com/questions/19849611/nuget-package-restore-is-enabled-but-i-get-an-error-saying-its-not-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!