简体   繁体   English

NuGet项目>添加库包参考未出现

[英]NuGet Project > Add Library Package Reference not appearing

I have installed NuGet. 我安装了NuGet。

When I try to go to Project > Add Library Package Reference 当我尝试转到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. 如果我再次尝试安装NuGet,它说它已经安装好了。 My application is an MVC 3 application targeting .net 4. 我的应用程序是一个针对.net 4的MVC 3应用程序。

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. 您也可以以管理员身份运行VS(Ctrl-Shift-Click),然后从包管理器对话框中卸载NuGet。 Then update to NuGet 1.1 from http://nuget.codeplex.com and see if that fixes it. 然后从http://nuget.codeplex.com更新到NuGet 1.1,看看是否修复了它。 ASP.NET MVC is not needed. 不需要ASP.NET MVC。

As of May 2012, it's now called "Manage NuGet Packages". 截至2012年5月,它现在被称为“管理NuGet包”。 Especially confusing because the screenshots in the NuGet Docs have not been updated. 特别令人困惑,因为NuGet Docs中的屏幕截图尚未更新。

https://stackoverflow.com/a/9844659/24267 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? Visual Studio的某些扩展是否可能导致NuGet无法显示菜单或崩溃? You could try to disable/remove them and then install NuGet from here: http://nuget.codeplex.com/ 您可以尝试禁用/删除它们,然后从这里安装NuGet: http//nuget.codeplex.com/

Besides, there is also a PowerShell-based Package Manager Console. 此外,还有一个基于PowerShell的Package Manager控制台。 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. 通常,NuGet随ASP.NET MVC 3一起安装,因此它应该自动出现。 Try removing the NuGet package that you have installed and reinstall ASP.NET MVC 3. 尝试删除已安装的NuGet包并重新安装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. 为了解决这个问题,我重命名了注册表项(如果它不起作用我可以重命名) HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0\\NuGet ,然后重新启动visual studio并打开一个项目。 The Add Library Package Reference now works and the registry key has been recreated. 现在可以使用“ Add Library Package Reference并且已重新创建注册表项。

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. 哎呀:没注意到已经提到了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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