NuGet导致Visual Studio 2013崩溃

6
我正在尝试更新Mvc Web项目中的NuGet依赖项。我进入我的项目,右键单击它,然后进入“管理NuGet程序包”。NuGet包管理器弹出,在“更新”下面我找到了我想要更新的具体程序包"Microsoft ASP.NET Web Pages"和"jQuery"。如果我点击其中一个,然后单击更新按钮,更新窗口就会弹出,但几乎立即就会崩溃。Visual Studio将重新启动,当我打开我的项目时,没有任何更新。错误提示是尝试写入受保护的内存。

有人知道这是什么原因吗?我在Windows 7上运行Visual Studio 2013 Update 4。

更新

作为对这个问题的跟进,我只想添加一些更多的细节。我使用/log标志运行Visual Studio,希望获得更多信息。这是文件中一些最后条目的转储:

<entry>
  <record>749</record>
  <time>2015/06/10 15:24:27.421</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
</entry>
<entry>
  <record>750</record>
  <time>2015/06/10 15:24:27.421</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [CctSharedPackage]</description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
</entry>
<entry>
  <record>751</record>
  <time>2015/06/10 15:24:27.514</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>End package load [CctSharedPackage]</description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
</entry>
<entry>
  <record>752</record>
  <time>2015/06/10 15:24:29.748</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
  <guid>{BC9CA0B3-BB4F-449A-967C-29A8FAE32086}</guid>
</entry>
<entry>
  <record>753</record>
  <time>2015/06/10 15:24:29.748</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [Microsoft VSDesigner WCF Package]</description>
  <guid>{BC9CA0B3-BB4F-449A-967C-29A8FAE32086}</guid>
</entry>
<entry>
  <record>754</record>
  <time>2015/06/10 15:24:29.763</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>End package load [Microsoft VSDesigner WCF Package]</description>
  <guid>{BC9CA0B3-BB4F-449A-967C-29A8FAE32086}</guid>
</entry>
<entry>
  <record>755</record>
  <time>2015/06/10 15:24:30.653</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function VBDispatch::GetTypeLib</description>
</entry>
<entry>
  <record>756</record>
  <time>2015/06/10 15:24:30.653</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Leaving function VBDispatch::GetTypeLib</description>
  <guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</guid>
</entry>
<entry>
  <record>757</record>
  <time>2015/06/10 15:24:30.653</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function VBDispatch::GetTypeLib</description>
</entry>
<entry>
  <record>758</record>
  <time>2015/06/10 15:24:30.653</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Leaving function VBDispatch::GetTypeLib</description>
  <guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</guid>
</entry>
<entry>
  <record>759</record>
  <time>2015/06/10 15:24:32.621</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>
<entry>
  <record>760</record>
  <time>2015/06/10 15:24:32.621</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [NuGetPackage]</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>
<entry>
  <record>761</record>
  <time>2015/06/10 15:24:32.637</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>End package load [NuGetPackage]</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
</entry>

对我来说,似乎没有任何异常或不合适的地方。我查看了日志文件中呈现的guid:

{5FCC8577-4FEB-4D04-AD72-D6C629B083CC} - NuGetConsole.Implementation.PowerConsoleToolWindow
{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} - SSMS DTE 12.0

我原本以为这只是一个特定项目的问题。但是当我创建一个新项目时,尝试对其进行更新时,发现同样出现了相同的问题。

在所有这些问题发生之前,我做的最后一件事就是安装Windows更新。我记得其中一个更新是Sql Server 2014 Update 1。我使用的是Management Studio 2014,但我想不出NuGet和Management Studio之间有任何关系。

因此,希望这些信息能够帮助我或其他人解决这个问题!大家有什么想法吗?

更新2

我从事件查看器中检索到异常并将其粘贴在这里:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at EnvDTE.ProjectItem.get_Kind()
   at NuGet.VisualStudio.ProjectExtensions+<>c__DisplayClassb.<GetChildItems>b__a(EnvDTE.ProjectItem)
   at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Linq.Enumerable.Any[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at NuGet.ProjectSystemExtensions.DeleteFiles(NuGet.IProjectSystem, System.Collections.Generic.IEnumerable`1<NuGet.IPackageFile>, System.Collections.Generic.IEnumerable`1<NuGet.IPackage>, System.Collections.Generic.IDictionary`2<NuGet.FileTransformExtensions,NuGet.IPackageFileTransformer>)
   at NuGet.ProjectManager.RemovePackageReferenceFromProject(NuGet.IPackage)
   at NuGet.ProjectManager.Execute(NuGet.PackageOperation)
   at NuGet.ProjectManager.Execute(NuGet.IPackage, NuGet.IPackageOperationResolver)
   at NuGet.ProjectManager.AddPackageReference(NuGet.IPackage, Boolean, Boolean)
   at NuGet.ProjectManager.UpdatePackageReference(NuGet.IPackage, Boolean, Boolean)
   at NuGet.VisualStudio.VsPackageManager+<>c__DisplayClass5a.<UpdatePackageReference>b__58()
   at NuGet.VisualStudio.VsPackageManager.RunProjectAction(NuGet.IProjectManager, System.Action)
   at NuGet.VisualStudio.VsPackageManager.UpdatePackageReference(NuGet.IProjectManager, NuGet.IPackage, Boolean, Boolean)
   at NuGet.VisualStudio.VsPackageManager+<>c__DisplayClass1a.<UpdatePackages>b__18()
   at NuGet.VisualStudio.VsPackageManager+<>c__DisplayClass67.<ExecuteOperationsWithPackage>b__65()
   at NuGet.VisualStudio.VsPackageManager.RunSolutionAction(System.Action)
   at NuGet.VisualStudio.VsPackageManager.ExecuteOperationsWithPackage(NuGet.IProjectManager, NuGet.IPackage, System.Collections.Generic.IEnumerable`1<NuGet.PackageOperation>, System.Action, NuGet.ILogger)
   at NuGet.VisualStudio.VsPackageManager.UpdatePackages(NuGet.IProjectManager, System.Collections.Generic.IEnumerable`1<NuGet.IPackage>, System.Collections.Generic.IEnumerable`1<NuGet.PackageOperation>, Boolean, Boolean, NuGet.ILogger)
   at NuGet.Dialog.Providers.UpdatesProvider.ExecuteCommand(NuGet.IProjectManager, NuGet.Dialog.Providers.PackageItem, NuGet.VisualStudio.IVsPackageManager, System.Collections.Generic.IList`1<NuGet.PackageOperation>)
   at NuGet.Dialog.Providers.OnlineProvider.ExecuteCommandOnProject(EnvDTE.Project, NuGet.Dialog.Providers.PackageItem, NuGet.VisualStudio.IVsPackageManager, System.Collections.Generic.IList`1<NuGet.PackageOperation>)
   at NuGet.Dialog.Providers.OnlineProvider.ExecuteCore(NuGet.Dialog.Providers.PackageItem)
   at NuGet.Dialog.Providers.PackagesProviderBase.OnRunWorkerDoWork(System.Object, System.ComponentModel.DoWorkEventArgs)
   at System.ComponentModel.BackgroundWorker.OnDoWork(System.ComponentModel.DoWorkEventArgs)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(System.Object)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, System.Object[] ByRef)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)
   at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

有一个与我的问题类似的StackOverflow问题,但是针对的是Visual Studio 2010。我们的堆栈跟踪是完全相同的。不幸的是,这个问题从未得到解答。

最终更新

我最终通过进入Visual Studio设置并修复安装来解决了这个问题。


@Sushil - 是的。不过我并不是在尝试构建它。 - Icemanind
嗯,通常我在调试时尝试更新它时会出现这种情况。你有其他可能会导致这种情况的 Visual Studio 插件吗? - Sushil
@Sushil - 我唯一使用的插件是 ReSharper。但我已经安装了它很长时间了。这是一个我刚创建的新项目,出于某种原因,它似乎只发生在这个项目中。 - Icemanind
我也是这么想的。你能看到这些链接并尝试它们的解决方案吗?http://www.seirer.net/blog/2014/5/20/visual-studio-2013-cant-update-nugetexe 和 http://www.seirer.net/blog/2014/5/20/visual-studio-2013-cant-update-nugetexe - Sushil
@Sushil - 这些对我不起作用。从包管理器控制台安装时,我看到它最后尝试的事情是删除旧版本的 Microsoft.AspNet.WebPages。这就是当 VS 2013 崩溃并弹出一个窗口“Visual Studio 2013 已停止工作”并重新启动时的情况。 - Icemanind
显示剩余2条评论
1个回答

1

修复你的VS 2013,然后建议卸载Nuget包管理器,下载并重新安装。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接