更新到VS Update 3后,为什么NuGet无法在Visual Studio 2012中加载?

时间:2013-07-10 18:02:04

标签: visual-studio nuget nuget-package

更新到Visual Studio 2012 Update 3(我之前运行的是Update 2)后,NuGet无法加载。我的意思是,在我加载了一个使用NuGet并且曾经工作的解决方案后,包管理器不再显示。 *它不会显示在“工具”菜单下。 *右键单击解决方案后,NuGet(管理NuGet包)不会显示在菜单中 *右键单击项目后,NuGet(管理NuGet包)不会显示在菜单中

“扩展和更新”对话框(TOOLS / Extensions and Updates ...)确实显示NuGet Package Manager已安装,当我点击它时,它显示可以卸载它。

当我在卸载然后重新安装NuGet Package Manager(从我在CodePlex nuget站点上的下载中)检查安装日志后,它显示它已成功安装:

 /10/2013 11:39:05 AM - Beginning to install extension to Microsoft Visual Studio Professional 2012...
7/10/2013 11:39:05 AM - Install to Microsoft Visual Studio Professional 2012 completed successfully. The extension has been installed to C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\\COMMON7\IDE\EXTENSIONS\VYALGTD2.XZS\

我检查过,这个文件夹确实存在并包含NuGet dll。

当我转到TOOLS / Options ...对话框并选择Package Manager时,右侧窗格显示文本:“加载此属性页时出错”。扩展程序包管理器并选择“常规”或“程序包源”时,将显示相同的文本。

我已经多次卸载并重新安装了NuGet,我已经从下载的VSIX中直接安装了两个,并直接在Extensions and Updates对话框中安装,结果总是一样。

我已经安装了旧版本的NuGet,我得到了相同的结果。我已经卸载了Visual Studio并重新安装了它,我在版本1,更新2或更新3中获得了相同的结果。

Activity.log.xml 文件在尝试加载NuGet时显示以下问题:

<entry>
  <record>211</record>
  <time>2013/07/10 17:39:44.295</time>
  <type>Information</type>
      <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>Successfully loaded component assembly from cache</description>
<path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\EXTENSIONS\VYALGTD2.XZS\NuGet.VisualStudio.dll</path>
</entry>
<entry>
  <record>212</record>
  <time>2013/07/10 17:39:44.295</time>
  <type>Information</type>
  <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
  <description>Successfully loaded component assembly from cache</description>
  <path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\EXTENSIONS\VYALGTD2.XZS\NuGet.Console.dll</path>
</entry>
<entry>
  <record>213</record>
  <time>2013/07/10 17:39:44.295</time>
  <type>Information</type>
  <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
  <description>Successfully loaded component assembly from cache</description>
  <path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\EXTENSIONS\VYALGTD2.XZS\NuGetConsole.Host.PowerShellProvider.dll</path>
</entry>
<entry>
  <record>214</record>
  <time>2013/07/10 17:39:44.298</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>End package load [Visual Studio Component Model Host Package]</description>
  <guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
</entry>
<entry>
  <record>215</record>
  <time>2013/07/10 17:39:44.383</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>End package load [Microsoft.VisualStudio.Editor.Implementation.EditorPackage]</description>
  <guid>{E269B994-EF71-4CE0-8BCD-581C217372E8}</guid>
</entry>

这部分看起来不错。但是有以下警告和错误:

<entry>
  <record>234</record>
  <time>2013/07/10 17:39:57.070</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{00000000-0000-0000-0000-000000000000} LANG:0409 ID:1003&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>235</record>
  <time>2013/07/10 17:39:57.072</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{00000000-0000-0000-0000-000000000000} LANG:0409 ID:1004&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>236</record>
  <time>2013/07/10 17:39:57.073</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:101&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>237</record>
  <time>2013/07/10 17:39:57.073</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:106&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>238</record>
  <time>2013/07/10 17:39:57.073</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:102&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>239</record>
  <time>2013/07/10 17:39:57.073</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:101&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>240</record>
  <time>2013/07/10 17:39:57.074</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:107&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>241</record>
  <time>2013/07/10 17:39:57.074</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:103&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>242</record>
  <time>2013/07/10 17:39:57.074</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:105&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>243</record>
  <time>2013/07/10 17:39:57.074</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Performance warning: String load failed. Pkg:{5FB7364D-2E8C-44A4-95EB-2A382E30FEC7} (EditorExtensionsPackage) LANG:0409 ID:104&#x000D;&#x000A;</description>
</entry>
<entry>
  <record>244</record>
  <time>2013/07/10 17:40:00.908</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>
<entry>
  <record>245</record>
  <time>2013/07/10 17:40:00.908</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [NuGet.Tools.NuGetPackage, NuGet.Tools, Version=2.6.40627.9000, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>
<entry>
  <record>246</record>
  <time>2013/07/10 17:40:00.915</time>
  <type>Error</type>
  <source>VisualStudio</source>
  <description>CreateInstance failed for package [NuGet.Tools.NuGetPackage, NuGet.Tools, Version=2.6.40627.9000, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
  <hr>80070002</hr>
  <errorinfo>Could not load file or assembly 'NuGet.Tools, Version=2.6.40627.9000, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
</entry>
<entry>
  <record>247</record>
  <time>2013/07/10 17:40:00.915</time>
  <type>Error</type>
  <source>VisualStudio</source>
  <description>End package load [NuGet.Tools.NuGetPackage, NuGet.Tools, Version=2.6.40627.9000, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
  <hr>80004005 - E_FAIL</hr>
  <errorinfo>Could not load file or assembly 'NuGet.Tools, Version=2.6.40627.9000, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
</entry>
<entry>
  <record>248</record>
  <time>2013/07/10 17:40:00.915</time>
  <type>Warning</type>
  <source>VisualStudio</source>
  <description>Package failed to load; error message suppressed by skip flag</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>
<entry>

主要线索记录246 -     无法加载文件或程序集'NuGet.Tools,Version = 2.6.40627.9000,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。系统找不到指定的文件。     

问题是为什么系统无法找到文件或缺少什么依赖项。 MSDN技术支持对我有所帮助,但随后决定这是一个他们不支持的问题,我应该在这里发布这个问题。

6 个答案:

答案 0 :(得分:28)

看看this link coops007对于NuGet问题有一个很好的解决方案。

以下是解决问题的步骤,适用于@Catherine:

  1. 从网上下载Nuget vsix软件包,而不是通过VS2012中的VS扩展库。
  2. 确保VS2012完全关闭。
  3. 运行VSIX安装程序两次(两者同时进行!)第一次安装,第二次安装已经安装。这是实际完成工作的第二个安装人员。
  4. 注意,如果您只运行一次安装程序,则VS2012内的错误仍然存​​在。此外,如果再次重新运行安装程序,则错误仍然存​​在。 您必须同时运行两次安装程序

答案 1 :(得分:4)

此方案适合我:

  • 下载NuGet Package Manager vsix文件
  • 像zip存档一样提取它
  • 将内容复制到NuGet扩展名所在的文件夹 安装(在我的系统上它是“c:\ Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ Extensions \ oabo2crw.lk3“)

答案 2 :(得分:0)

如果有帮助的话。 。

我也有“NuGet.Tools”的Could not load file or assembly错误。我在Windows 8.1上运行Visual Studio Professional 2012并且(在尝试许多其他推荐的解决方案之后)以下步骤对我有用:

  1. 以管理员身份跑VS2012(此时我所做的一切都是管理员......以防万一)
  2. NuGet Package Manager菜单中的Extensions and Updates...对话框中卸载Tools
  3. 重新启动Visual Studio
  4. 从他们的网站下载了“Nuget.Tools.vsix”文件。在选择NuGet包时,可以通过单击Extensions and Updates...对话框的包信息部分中的更多信息链接找到此信息。
  5. 关闭Visual Studio 2012。
  6. Ran powershell作为管理员。
  7. 导航到我保存.VSIX文件的位置。
  8. 从powershell中删除.VSIX文件。
  9. 基本上我只是使用powershell手动安装了软件包。之后,我刚刚重新启动Visual Studio并且没有更多错误。

答案 3 :(得分:0)

我在使用Visual Studio 2015社区版并遇到同样的错误。就我而言,只需转到工具&gt;即可解决问题。扩展和更新并卸载&#34; Nuget Package Manager for Visual Studio&#34;,重新启动Visual Studio,然后再次安装此扩展。完美无缺,现在没有任何错误。也许现在简化了安装程序,因此只需重新安装即可解决问题。

答案 4 :(得分:0)

这让我失去了一段时间。结束时删除了一个名为whacky的文件夹:

f(...)

我是C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions 并从qlpuoyw3.ayw文件重新安装。像冠军一样工作。还清除了与其他扩展程序相同的错误。

答案 5 :(得分:-1)

我解决了这个特殊问题,但它让我走上了下一期的道路。以下是我为解决此问题所做的工作,希望对其他人有所帮助:

  1. 卸载Visual Studio 2012(控制面板 - 程序和功能 - Microsoft Visual Studio Professional 2012)
  2. 删除VS 2012 程序文件和程序文件(x86)下的文件夹。实际的名字 是Microsoft Visual Studio 11.0(非常差,卸载 不要删除文件夹)。
  3. 从Registry中删除VS 2012条目 HKEY_CURRENT_USER和HKEY_LOCAL_MACHINE(这些将是11.0 Visual Studio下的条目)
  4. 重新安装Visual Studio 2012(我得到了我的 来自MSDN订阅下载的版本)
  5. 这解决了我在软件包管理器中遇到的问题,但是我遇到了一个不同的问题,即Web.Mvc.Package.MvcPackage没有正确加载,然后我的解决方案将不再识别项目文件以获得我的解决方案,因为它表明它是不兼容的。因此,我将重新卸载并删除与MVC 4相关的Visual Studio 2012(文件夹和注册表)下的所有条目,然后重新安装。