简体   繁体   中英

NuGet Project > Add Library Package Reference not appearing

I have installed NuGet.

When I try to go to Project > Add Library Package Reference

"Add Library Package Reference" is not under the project menu. If I try to install NuGet again it says it is already installed. My application is an MVC 3 application targeting .net 4.

How can I get this option to appear?

You might also run VS as Admin (Ctrl-Shift-Click) then uninstall NuGet from the package manager dialog. Then update to NuGet 1.1 from http://nuget.codeplex.com and see if that fixes it. ASP.NET MVC is not needed.

As of May 2012, it's now called "Manage NuGet Packages". Especially confusing because the screenshots in the NuGet Docs have not been updated.

https://stackoverflow.com/a/9844659/24267

Is it possible that some of the extensions of your Visual Studio are causing NuGet to not show the menu or crash? You could try to disable/remove them and then install NuGet from here: http://nuget.codeplex.com/

Besides, there is also a PowerShell-based Package Manager Console. You could take a look on that in case everything fails.

确保选择了项目,而不是解决方案资源管理器中的解决方案。

Normally NuGet is installed with ASP.NET MVC 3 so it should appear automatically. Try removing the NuGet package that you have installed and reinstall ASP.NET MVC 3.

I've just had a similar problem, after trying to install a package over dial-up, which timed out.

To fix it, I renamed the registry key (so that I could rename it back if it didn't work) HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0\\NuGet , then restarted visual studio and opened a project. The Add Library Package Reference now works and the registry key has been recreated.

Had this same issue, just realized that if you're not on the project (ie, you have the solution highlighted in solution explorer) that the option for the Add Library Package Reference won't show. Select the project and it's there.

Whoops: Didn't notice that was already mention.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM