Visual Studio 2017在加载解决方案时崩溃

时间:2016-11-16 20:36:51

标签: visual-studio-2017

我的VS 2017在EventViewer中不断出现以下错误。知道为什么会崩溃吗?

Exception Info: System.InvalidOperationException
   at System.Linq.Enumerable.Single[[System.Byte, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<Byte>)
   at System.Linq.ImmutableArrayExtensions.SingleOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Immutable.ImmutableArray`1<System.__Canon>, System.Func`2<System.__Canon,Boolean>)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker.GetOrCreateProjectFromArgumentsAndReferences(Microsoft.VisualStudio.LanguageServices.ProjectSystem.IWorkspaceProjectContextFactory, System.String, System.Collections.Generic.IReadOnlyDictionary`2<System.String,Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DeferredProjectInformation>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker.GetOrCreateProjectFromArgumentsAndReferences(Microsoft.VisualStudio.LanguageServices.ProjectSystem.IWorkspaceProjectContextFactory, System.String, System.Collections.Generic.IReadOnlyDictionary`2<System.String,Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DeferredProjectInformation>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+<PopulateWorkspaceFromDeferredProjectInfoAsync>d__86.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+<LoadSolutionFromMSBuildAsync>d__79.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Roslyn.Utilities.TaskExtensions+<FireAndForget>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(System.Object)
   at Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector.TryExecute()
   at Microsoft.VisualStudio.Threading.JoinableTaskFactory+SingleExecuteProtector+<>c.<.cctor>b__20_0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(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.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

1 个答案:

答案 0 :(得分:14)

解决此问题: 尝试删除驻留在解决方案文件旁边的.vs文件夹(默认情况下是隐藏的)。 这将使VS忘记该解决方案的任何IDE设置,例如打开的文件或断点位置。如果您不想丢失这些设置,请改为移动/重命名目录。

提供反馈并帮助改进产品: 在应用变通方法之前,请尝试捕获该问题的故障转储。然后,使用VS中的“报告崩溃”功能或在http://connect.microsoft.com/visualstudio上提交问题进行报告。