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

ees*_*esh 13 visual-studio nuget nuget-package

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

"扩展和更新"对话框(TOOLS/Extensions和Updates ...)确实将NuGet软件包管理器显示为已安装,当我单击它时,它显示可以卸载它.

此外,当我在卸载然后重新安装NuGet软件包管理器(从我在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\
Run Code Online (Sandbox Code Playgroud)

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

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

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

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

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

<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>
Run Code Online (Sandbox Code Playgroud)

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

<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>
Run Code Online (Sandbox Code Playgroud)

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

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

小智 28

看看这个链接到coops007有一个很好的解决NuGet问题.

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

  1. 从网上下载Nuget vsix软件包,而不是通过VS2012中的VS扩展库.
  2. 确保VS2012完全关闭.
  3. 运行VSIX安装程序两次(两者同时!)第一个将安装,第二个表示它已经安装.这是实际完成工作的第二个安装人员.

请注意,如果您只运行一次安装程序,则VS2012内的错误仍然存​​在.此外,如果再次重新运行安装程序,则错误仍然存​​在.您必须同时运行安装程序两次


ees*_*esh -1

我解决了这个特定问题,但它只是让我走向下一个问题。以下是我为解决此问题所做的操作,希望对其他人有所帮助:

  1. 卸载 Visual Studio 2012(控制面板 - 程序和功能 - Microsoft Visual Studio Professional 2012)
  2. 删除Program Files和Program Files(x86)下的VS 2012文件夹。实际名称是Microsoft Visual Studio 11.0(非常糟糕的是卸载并没有删除文件夹)。
  3. 从注册表 HKEY_CURRENT_USER 和 HKEY_LOCAL_MACHINE 中删除 VS 2012 条目(这些将是 Visual Studio 下的 11.0 条目)
  4. 重新安装 Visual Studio 2012(我的版本是从 MSDN 订阅下载中获取的)

这解决了我在包管理器中遇到的问题,但我遇到了另一个问题,即 Web.Mvc.Package.MvcPackage 无法正确加载,然后我的解决方案将不再识别我拥有的解决方案的项目文件,因为它表明这是不兼容的。因此,我重新卸载并删除 Visual Studio 2012(文件夹和注册表)下与 MVC 4 有关的所有条目,然后再次重新安装。