2013-04-18 189 views
3

加載Visual Studio 2012時出現錯誤:「遇到異常,這可能是由擴展引起的。」Visual Studio 2012加載錯誤

這裏是從XML文件中的信息:

System.ComponentModel.Composition.CompositionException: The composition produced a single composition error, with 2 root causes. 
The root causes are provided below. 
Review the CompositionException.Errors property for more detailed information. 
) The export Microsoft.VisualStudio.Shell.SVsServiceProvider is not assignable to type System.Boolean. 

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager.IsKnockoutEnabled (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager.IsKnockoutEnabled (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager 

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager 

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider.teBufferFeatureManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider.teBufferFeatureManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider 

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider 

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider 

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider 

2) The export 'Microsoft.VisualStudio.Web.Extensions.HTML.TagNameProvider (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider")' is not assignable to type 'System.Collections.Generic.ISet`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. 

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider.SupportedTagNames (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider.SupportedTagNames (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet 

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet 

Resulting in: Cannot set import 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.TagNameProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider")' on part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.TagNameProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider 

Resulting in: Cannot get export 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider")' from part 'Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider'. 
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider 

    at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition) 
    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart) 
    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore() 
    at System.ComponentModel.Composition.Primitives.Export.get_Value() 
    at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export) 
    at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedLazyOfTM>b__1() 
    at System.Lazy`1.CreateValue() 
    at System.Lazy`1.LazyInitValue() 
    at System.Lazy`1.get_Value() 
    at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)</description> 

有誰知道我可以修復它?

問候,

本傑明

+0

你安裝了什麼擴展? –

回答

1

酷,這是爲我工作,更新Web.config文件中的組件標籤。在項目加載過程中,IDE無法加載這些程序集。所以這裏是我的下面...

  <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
    <add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
    <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
    <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
    <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
+1

如果它仍然存在,請嘗試更新一些插件,特別是Web Essentials插件。 – dblay

+0

是的 - 我有與OP相似的錯誤,「2個根本原因」 - 儘管堆棧跟蹤不同,更新Web Essentials解決了這個問題。 – jaminto