VS2012在安装更新包后不能创建与打开项目

在安装目录“C:\Users\Administrator\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml”-->VS的活动log中记录的错误信息是

“Construction of frame content failed.
Frame identifier: ST:0:0:{28836128-fc2c-11d2-a433-00c04f72d18a}
Frame caption: 命令窗口
Exception details:
System.ComponentModel.Composition.ImportCardinalityMismatchException: 未找到与约束 
	ContractName	Microsoft.VisualStudio.Utilities.IContentTypeRegistryService
	RequiredTypeIdentity	Microsoft.VisualStudio.Utilities.IContentTypeRegistryService 匹配的导出
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T](String contractName)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T]()
   在 Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
   在 Microsoft.VisualStudio.Editor.Implementation.EditorParts.get_ContentTypeRegistryService()
   在 Microsoft.VisualStudio.Editor.Implementation.LanguageServiceToContentTypeMapper.MakeLanguageServiceContentTypes(SettingsStore settingsStore)
   在 Microsoft.VisualStudio.Editor.Implementation.LanguageServiceToContentTypeMapper.InitLanguageServiceToContentTypeMapper(IServiceProvider serviceProvider, IComponentModel componentModel)
   在 Microsoft.VisualStudio.Editor.Implementation.VsDocDataAdapter.SetSite(Object pUnkSite)
   在 Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.SetSite(Object pUnkSite)
   在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   在 Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()”

 

在网上找到了一些解决方法,其中一种是:

卸载两个补丁:KB2833957和KB2840642,但我的电脑只有KB2833957,没有找到KB2840642,找到了KB2840642(v2), 当我把这两个补丁卸载后,重启电脑,仍然不能正常打开VS2012

第二种方法:

安装补丁KB2781514,这个补丁是主要解决在 .NET Framework 4.5 更新之后,Visual Studio 用户可能无法打开或创建 C++ 或 JavaScript 文件或项目。

在安装完补丁KB2781514后,VS2012可以正常创建或打开项目工程了。

还是第二种方法直接一些。

posted @ 2014-04-12 16:59  __虚竹__  阅读(1989)  评论(0编辑  收藏  举报