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

时间:2023-01-28 14:42:03

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. My application is an MVC 3 application targeting .net 4.

“添加库包参考”不在项目菜单下。如果我再次尝试安装NuGet,它说它已经安装好了。我的应用程序是一个针对.net 4的MVC 3应用程序。

How can I get this option to appear?

如何才能显示此选项?

7 个解决方案

#1


2  

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/

您的Visual Studio的某些扩展是否可能导致NuGet无法显示菜单或崩溃?您可以尝试禁用/删除它们,然后从这里安装NuGet: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.

此外,还有一个基于PowerShell的软件包管理器控制台。如果一切都失败,你可以看一下。

#2


5  

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.

您也可以以管理员身份运行VS(Ctrl-Shift-Click),然后从包管理器对话框中卸载NuGet。然后从http://nuget.codeplex.com更新到NuGet 1.1,看看是否修复了它。不需要ASP.NET MVC。

#3


2  

Make sure you have the project selected and not the solution in the solution explorer.

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

#4


2  

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

截至2012年5月,它现在被称为“管理NuGet包”。特别令人困惑,因为NuGet Docs中的屏幕截图尚未更新。

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

#5


0  

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.

通常,NuGet随ASP.NET MVC 3一起安装,因此它应该自动出现。尝试删除已安装的NuGet包并重新安装ASP.NET MVC 3。

#6


0  

Had this same issue, just realized that if you're not on the project (i.e., 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.

哎呀:没注意到已经提到了。

#7


0  

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.

为了解决这个问题,我重命名了注册表项(如果它不起作用我可以重命名)HKEY_CURRENT_USER \ Software \ Microsoft \ VisualStudio \ 10.0 \ NuGet,然后重新启动visual studio并打开一个项目。现在可以使用“添加库包参考”,并且已重新创建了注册表项。

#1


2  

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/

您的Visual Studio的某些扩展是否可能导致NuGet无法显示菜单或崩溃?您可以尝试禁用/删除它们,然后从这里安装NuGet: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.

此外,还有一个基于PowerShell的软件包管理器控制台。如果一切都失败,你可以看一下。

#2


5  

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.

您也可以以管理员身份运行VS(Ctrl-Shift-Click),然后从包管理器对话框中卸载NuGet。然后从http://nuget.codeplex.com更新到NuGet 1.1,看看是否修复了它。不需要ASP.NET MVC。

#3


2  

Make sure you have the project selected and not the solution in the solution explorer.

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

#4


2  

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

截至2012年5月,它现在被称为“管理NuGet包”。特别令人困惑,因为NuGet Docs中的屏幕截图尚未更新。

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

#5


0  

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.

通常,NuGet随ASP.NET MVC 3一起安装,因此它应该自动出现。尝试删除已安装的NuGet包并重新安装ASP.NET MVC 3。

#6


0  

Had this same issue, just realized that if you're not on the project (i.e., 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.

哎呀:没注意到已经提到了。

#7


0  

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.

为了解决这个问题,我重命名了注册表项(如果它不起作用我可以重命名)HKEY_CURRENT_USER \ Software \ Microsoft \ VisualStudio \ 10.0 \ NuGet,然后重新启动visual studio并打开一个项目。现在可以使用“添加库包参考”,并且已重新创建了注册表项。