VS2015打开cs文件时崩溃(VS2015 crashes when opening .cs fi

2019-10-28 12:41发布

我可以打开VS2015一个解决方案或项目,但是当我尝试打开(在我的情况)一个CSHARP代码文件(的.cs)的Visual Studio崩溃(而不是在一个巧妙的方法)。

创建一个新的代码文件时,如A类此的情况也是如此。

  • 访问.log文件没有产生错误。
  • 删除组件缓存没有帮助

这里从事件日志条目:

应用:devenv.exe的框架版本:v4.0.30319说明:通过System.Environment.FailFast(字符串消息)的应用所请求的过程终止。 消息:发生一个或多个错误:System.AggregateException。 ---> System.EntryPointNotFoundException:入口点没有被发现。 在Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFile(SemanticModel semanticModel,的CancellationToken的CancellationToken)在Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.d__3.MoveNext()---从先前的位置,其中堆栈跟踪结束除了在Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.d__1.MoveNext抛出---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(工作任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务task) ()---从先前的位置在那里引发异常---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(工作任务)在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(工作任务)在系统堆栈跟踪的结尾。 Runtime.CompilerServices.TaskAwaiter.ValidateEnd(任务task)在Microsoft.CodeAnalysis.Editor.Implementation.Navigation Bar.NavigationBarController.d__29.MoveNext()---内部异常堆栈跟踪的末尾在System.Threading.Tasks.Task.ThrowIfExceptional(布尔includeTaskCanceledExceptions)在System.Threading.Tasks.Task 1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task 1.get_Result()在Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController。<> c__DisplayClass32_0.b__0(任务1 t) at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass12_1 2.b__1(任务_)在Roslyn.Utilities.TaskExtensions <> c__DisplayClass6_0。 1.<SafeContinueWith>b__0(Task t) ---> (Inner Exception #0) System.EntryPointNotFoundException: Entry point was not found. at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFile(SemanticModel semanticModel, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetTypesInFileAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetItemsAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<ComputeModelAsync>d__29.MoveNext()<--- Stack: at System.Environment.FailFast(System.String, System.Exception) at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action 1.<SafeContinueWith>b__0(Task t) ---> (Inner Exception #0) System.EntryPointNotFoundException: Entry point was not found. at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFile(SemanticModel semanticModel, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetTypesInFileAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetItemsAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<ComputeModelAsync>d__29.MoveNext()<--- Stack: at System.Environment.FailFast(System.String, System.Exception) at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action 1.<SafeContinueWith>b__0(Task t) ---> (Inner Exception #0) System.EntryPointNotFoundException: Entry point was not found. at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetTypesInFile(SemanticModel semanticModel, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetTypesInFileAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetItemsAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<ComputeModelAsync>d__29.MoveNext()<--- Stack: at System.Environment.FailFast(System.String, System.Exception) at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action 1)在Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception的)在Roslyn.Utilities.TaskExtensions + <> c__DisplayClass6_0 1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWith>b__0(System.Threading.Tasks.Task) at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean) at System.Threading.Tasks.Task 1 [[系统.__佳能,mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089]]。GetResultCore(布尔型)在System.Threading.Tasks.Task 1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Result() at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<>c__DisplayClass32_0.<StartSelectedItemUpdateTask>b__0(System.Threading.Tasks.Task 1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Result() at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController+<>c__DisplayClass32_0.<StartSelectedItemUpdateTask>b__0(System.Threading.Tasks.Task在Roslyn.Utilities.TaskExtensions 1)+ <> c__DisplayClass12_1 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]].<ContinueWithAfterDelay>b__1(System.Threading.Tasks.Task) at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_0 1 [[系统.__佳能,mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089]]。在System.Threading.Tasks.ContinuationResultTaskFromTask`1 b__0(System.Threading.Tasks.Task) [[系统.__佳能,mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089]]。InnerInvoke()在System.Threading.Tasks.Task.Execute()在System.Threading.Tasks.Task.ExecutionContextCallback( System.Object的)在System.Threading.ExecutionContext.RunInternal(System.Threading.Ex ecutionContext,System.Threading.ContextCallback,System.Object的,布尔型)在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object的,布尔值)在System.Threading.Tasks.Task。 ExecuteWithThreadLocal(System.Threading.Tasks.Task为ByRef)在System.Threading.Tasks.Task.ExecuteEntry(布尔)在System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()在System.Threading.ThreadPoolWorkQueue.Dispatch ()在System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Answer 1:

得到它了!! 我想我的答案张贴到本作其他任何人有这个问题。 我用VS2015更新3。

解决的办法是在事件日志中错误文本,特别是“Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar”。

>选项 - - 我使用禁用的工具导航栏>文本编辑器 - > C# - >常规,选中导航栏选项。 装载我的解决方案 - 项目后,我可以打开代码编辑器。



Answer 2:

您是否尝试过上运行在Visual Studio 2015年安装的修复选项? 您可以启动从Windows的程序和功能控制面板。

{编辑}

你能够推出VS在安全模式? 您可以通过寻找的devenv.exe的\Common7\IDE\安装VS其中的子目录。 打开命令提示符,然后导航到该目录,然后运行以下命令:

devenv.exe /safemode

如果你可以在这个模式下加载一个CS文件,同时,那么它也许是造成问题与VS.第三方扩展

{/编辑}



Answer 3:

这是任何cs文件,或特定的一个? 扩展什么你已经安装了? 这可能是第三方的扩展,它失败。



Answer 4:

确保文件的权限是一致的。 如果binobj文件夹不能被访问时,Visual Studio可能会崩溃。 设置文件所有权和权限在文件属性 - >安全 - >高级。



Answer 5:

我通过清除Visual Studio的组件模型缓存解决了这个问题。

只需删除或重命名该文件夹(复制以下网址并将其粘贴Windows资源管理器的地址路径,然后按Enter):

%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache

要么

%LocalAppData%\Microsoft\VPDExpress\11.0\ComponentModelCache

并重新启动Visual Studio。

你必须在Visual Studio的版本由数例如指定

的Visual Studio 2012是11.0(如上所示)

的Visual Studio 2013为12.0

的Visual Studio 2015年是14.0

的Visual Studio 2017年是15.0

对于那些不知道: %LocalAppData%\是一样的C:\Users\{yourUsername}\AppData\Local



文章来源: VS2015 crashes when opening .cs file