2015-05-04 249 views
5

當我打開現有的C#項目或創建新的C#項目時,我的visual studio 2015 RC崩潰。如果我創建或打開一個C++項目,它不會崩潰。Visual Studio 2015與C#項目崩潰

這裏是堆棧:

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) 
+0

我已經嘗試使用/ force卸載,重置VS設置,在安全模式下啓動VS並刪除%AppData%\ Local \ microsoft \ VisualStudio \ 14.0 \ ComponentModelCache文件夾。 –

+0

也有同樣的問題 – Suhan

+0

我與VS 2015 Enterprise RTM有同樣的問題。 –

回答

5

我有這個問題既VS 2015年企業RC和RTM。我注意到,VS 2015 RTM顯示了重複的項目模板(例如,C#控制檯應用程序已列出兩次)。

我認爲在安裝VS 2015 RTM之前運行的VS 2015 RC的卸載例程在我的機器上留下了一些導致問題的東西。

這是我做過什麼來解決我的機器(測試系統,而不是我的日常生產開發機()!)對這個問題:

  • 創建系統還原點
  • 卸載VS 2015年RC
  • 手動刪除該文件夾:C:\ Program Files文件(x86)的\微軟的Visual Studio 14.0
  • 手動刪除該文件夾:C:\用戶\\應用程序數據\本地\微軟\ VisualStudio的\ 14.0
  • 手動刪除夾: C:\用戶\\應用程序數據\漫遊\微軟\ VisualStudio的\ 14.0
  • 重啓
  • 重新安裝VS 2015年RTM(顯示的一些問題)
  • 修復VS 2015年RTM

現在一切似乎工作預期。