asp.net-mvc 在 VS 2012 中创建 MVC4 项目时出现 NuGet 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13312602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 02:24:05  来源:igfitidea点击:

NuGet error on creating MVC4 Project in VS 2012

asp.net-mvcasp.net-mvc-4visual-studio-2012nuget

提问by Geasi Puozzo

I tried to create a MVC4 empty project in VisualStudio 2012 Ultimate, but I got this error:

我试图在 VisualStudio 2012 Ultimate 中创建一个 MVC4 空项目,但出现此错误:

"Error: this template attempted to load component assembly 'NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.".

“错误:此模板试图加载组件程序集‘NuGet.VisualStudio.Interop,版本=1.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’。”。

回答by Bhavesh Chauhan

I believe you do not have NuGet Package Manager extension installed.

我相信您没有安装 NuGet 包管理器扩展。

If not, you can click TOOLS-> Extensions and Updates...-> Online, select NuGet Package Manager, and click Download:

如果没有,您可以单击TOOLS-> Extensions and Updates...-> Online,选择NuGet Package Manager,然后单击Download

enter image description here

在此处输入图片说明

After it downloads, you will be prompted for administrative elevation, and then to restart Visual Studio.

下载后,系统将提示您进行管理提升,然后重新启动 Visual Studio。

Tested in:Visual Studio Ultimate 2012 (Version 11.0.60610.01 Update 3)

已测试:Visual Studio Ultimate 2012(版本 11.0.60610.01 更新 3)

UPDATE: I've just came across this problem in Visual Studio 2012. So despite some comments here, it is not necessarily installed by default.

更新:我刚刚在 Visual Studio 2012 中遇到了这个问题。所以尽管这里有一些评论,但它不一定是默认安装的。

回答by Mahdi Zareie

i) Open Visual Studio > Tools > Extensions and Updates > select 'NuGet Package Manager' and uninstall it.(if it's not installed go to step 2)

i) 打开 Visual Studio > 工具 > 扩展和更新 > 选择“NuGet 包管理器”并卸载它。(如果未安装,请转到第 2 步)

ii) Open this url 'http://nuget.org' and you will see an 'Install NuGet' link , download it(NuGet.Tools.vsix) and install it on your Visual Studio .

ii) 打开这个 url ' http://nuget.org',你会看到一个 'Install NuGet' 链接,下载它(NuGet.Tools.vsix)并将它安装在你的 Visual Studio 上。

iii) Close and Re-open the Visual Studio and i believe you will never see that error Dialog again just like me ;-)

iii) 关闭并重新打开 Visual Studio,我相信您再也不会像我一样看到那个错误对话框了 ;-)

回答by scott_lotus

Same issue.

同样的问题。

"Error: this template attempted to load component assembly 
'NuGet.VisualStudio.Interop .... "
when creating a new Web Role project in VS 2012.

Selecting:

选择:

  • TOOLS
  • Extensions and Updates
  • Online
  • Select NuGet Package Manager
  • Click Download
  • i could see NuGet was installed already
  • I removed it
  • installed it again
  • restarted VS
  • 工具
  • 扩展和更新
  • 在线的
  • 选择 NuGet 包管理器
  • 点击下载
  • 我可以看到 NuGet 已经安装
  • 我删除了它
  • 重新安装了
  • 重新启动VS

Resolved.

解决。

Thanks for the information above + 1. Scott

感谢以上信息 + 1. 斯科特

回答by Deepak

you might want to search and check the dll exists under \Microsoft Visual Studio 11.0\Common7\IDE\Extensions\ (it would be in a folder under extensions with other nuget binaries). If it doesn't exist you can try uninstalling and re-installing nuget. to uninstall: tools->extensions and updates -> installed (on the left pane)-> nuget package manager to install: tools->extensions and updates -> online->visualstudio gallery -> nuget package manager

您可能想要搜索并检查 \Microsoft Visual Studio 11.0\Common7\IDE\Extensions\ 下存在的 dll(它将位于具有其他 nuget 二进制文件的扩展名下的文件夹中)。如果它不存在,您可以尝试卸载并重新安装nuget。卸载:工具->扩展和更新->已安装(在左窗格中)-> nuget包管理器安装:工具->扩展和更新->在线->visualstudio画廊-> nuget包管理器

回答by Maheswari

Open Visual Studio and go to Tools- > Open Extension Manager or Extension and Updates - > Uninstall Nuget Package Manager -> Then Download Nuget Manager again from Online Gallery and then restart visual studio and you wont see the error message.

打开 Visual Studio 并转到 Tools-> Open Extension Manager 或 Extension and Updates -> Uninstall Nuget Package Manager -> 然后再次从 Online Gallery 下载 Nuget Manager,然后重新启动 Visual Studio,您将不会看到错误消息。