Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2015 crashes with C# projects

My visual studio 2015 RC is crashing when I open either existing C# project or creates a new C# project. It does not crash if I create or open a C++ project.

Here is the stack:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.MiscellaneousFilesWorkspace" but found 0 after applying applicable constraints.
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]()
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()
   at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
   at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`2.Initialize()
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
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<System.Exception>)
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(Microsoft.VisualStudio.Composition.ImportDefinition)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, Microsoft.VisualStudio.Composition.ImportCardinality)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String)
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
   at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
   at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
   at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`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]].Initialize()
   at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize()
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(Microsoft.VisualStudio.OLE.Interop.IServiceProvider)
like image 310
Martin Ingvar Kofoed Jensen Avatar asked May 04 '15 14:05

Martin Ingvar Kofoed Jensen


1 Answers

I had this issue with both VS 2015 Enterprise RC and RTM. What I noticed is that VS 2015 RTM displayed duplicate project templates (e.g. C# Console Application was listed twice).

I think that the uninstall routine of VS 2015 RC that ran prior to installing VS 2015 RTM left some stuff on my machine that caused the issues.

This is what I did to fix the issue on my machine (a test system, not my everyday production developer machine (!)):

  • create a system restore point
  • uninstall VS 2015 RC
  • manually delete the folder: C:\Program Files (x86)\Microsoft Visual Studio 14.0
  • manually delete the folder: C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0
  • manually delete the folder: C:\Users\\AppData\Roaming\Microsoft\VisualStudio\14.0
  • reboot
  • reinstall VS 2015 RTM (displayed some problems)
  • repaired VS 2015 RTM

Now everything seems to work as expected.

like image 80
Marcel Studer Avatar answered Sep 29 '22 07:09

Marcel Studer