I can open a Solution or Project in VS2015 but when I try and open (in my case) a csharp code file (.cs) Visual Studio crashes (and not in a smart way).
This is also the case when creating a new code file, such as a class.
- Accessing the .log file yielded no errors.
- Deleting the Component Cache did not help
Here the entry from the Event Log:
Application: devenv.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: System.AggregateException: One or more errors occurred. ---> 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.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.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.d__29.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.get_Result() at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<>c__DisplayClass32_0.b__0(Task1 t) at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass12_1
2.b__1(Task _) at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass6_01.<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) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception) at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_01[[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[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResultCore(Boolean) at System.Threading.Tasks.Task1[[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) at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass12_12[[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[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].b__0(System.Threading.Tasks.Task) at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Threading.Tasks.Task.ExecutionContextCallback(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.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.ExecuteEntry(Boolean) at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Got it!! I wanted to post my answer to this for anyone else that has this problem. I was using VS2015 Update 3.
The solution was in the Event Log error text, notably "Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar".
I disabled the Navigation Bar using Tools -> Options -> Text Editor -> C# -> General and unchecked the Navigation Bar option. After loading my Solution-Project I could open the code editor.
Have you tried running the repair option on the Visual Studio 2015 installation? You can launch that from the Windows Programs and Features control panel.
{Edit}
Are you able to launch VS in safe mode? You can do that by finding the devenv.exe in the
\Common7\IDE\
sub directory of where VS is installed. Open a command prompt and navigate to that directory, then run the following:If you can load a CS file while in this mode, then it maybe a 3rd party extension that is causing an issue with VS.
{/Edit}
I solved this problem by clearing Visual Studio Component Model Cache.
Just delete or rename this folder (copy below url and paste it on windows explorer address path and press enter):
or
and restart Visual Studio.
The version of Visual Studio you have is specified by the number e.g.
Visual Studio 2012 is 11.0 (as shown above)
Visual Studio 2013 is 12.0
Visual Studio 2015 is 14.0
Visual Studio 2017 is 15.0
For those that don't know:
%LocalAppData%\
is the same asC:\Users\{yourUsername}\AppData\Local
Make sure file permissions are consistent. If the
bin
orobj
folders can't be accessed, Visual Studio may crash. Set file ownership and permissions in file properties -> security -> advanced.Is it any .cs file, or specific one? What extensions do you have installed? It might be third party extension which fails.