2012-09-20 100 views
5

所以,我使用Visual Studio 2010,並在過去一週我越來越從Visual Studio來了一條消息:「Visual Studio中遇到的異常,這可能由以下原因引起一個延伸。「Visual Studio中遇到異常

我ActivityLog.xml表明將這一情況記錄問題:

<entry> 
    <record>321</record> 
    <time>2012/09/20 16:52:36.126</time> 
    <type>Error</type> 
    <source>Editor or Editor Extension</source> 
    <description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. 
Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) Object reference not set to an instance of an object.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: An exception occurred while calling the &apos;OnImportsSatisfied&apos; method on type &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot activate part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword --&gt; Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot get export &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword (ContractName=&quot;Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition&quot;)&apos; from part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword (ContractName=&quot;Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition&quot;) --&gt; Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&#x000D;&#x000A;&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()&#x000D;&#x000A; at System.ComponentModel.Composition.Primitives.Export.get_Value()&#x000D;&#x000A; at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)&#x000D;&#x000A; at System.ComponentModel.Composition.ExportServices.&lt;&gt;c__DisplayClass4`2.&lt;CreateStronglyTypedExportOfTM&gt;b__1()&#x000D;&#x000A; at System.Lazy`1.CreateValue()&#x000D;&#x000A; at System.Lazy`1.LazyInitValue()&#x000D;&#x000A; at System.Lazy`1.get_Value()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension](Object errorSource, Lazy`1 provider)</description> 
</entry> 

<entry> 
    <record>322</record> 
    <time>2012/09/20 16:52:36.202</time> 
    <type>Error</type> 
    <source>Editor or Editor Extension</source> 
    <description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) Object reference not set to an instance of an object.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: An exception occurred while calling the &apos;OnImportsSatisfied&apos; method on type &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot activate part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment --&gt; Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot get export &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment (ContractName=&quot;Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition&quot;)&apos; from part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment (ContractName=&quot;Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition&quot;) --&gt; Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&#x000D;&#x000A;&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)&#x000D;&#x000A; at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()&#x000D;&#x000A; at System.ComponentModel.Composition.Primitives.Export.get_Value()&#x000D;&#x000A; at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)&#x000D;&#x000A; at System.ComponentModel.Composition.ExportServices.&lt;&gt;c__DisplayClass4`2.&lt;CreateStronglyTypedExportOfTM&gt;b__1()&#x000D;&#x000A; at System.Lazy`1.CreateValue()&#x000D;&#x000A; at System.Lazy`1.LazyInitValue()&#x000D;&#x000A; at System.Lazy`1.get_Value()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension](Object errorSource, Lazy`1 provider)</description> 
</entry> 

似乎沒有是導致此任何具體行動,有時會發生當我第一次火了VS,我離開後,有時我的桌子一會兒回來。另外,從日誌中,它似乎在加載Visual Studio CSS編輯包後立即發生。我安裝了MVC4,也許是與新的CSS問題(CSS3我覺得呢?)

不管怎麼說,只是不知道是否有人已經先運行到這一點,並有某種分辨率。

+0

http://stackoverflow.com/a/20301710/736079 – jessehouwing

回答

5

似乎有些VS延長可能會導致其崩潰。 (你安裝任何擴展名爲最近還好嗎?)

嘗試在安全模式下運行VS診斷問題。

運行這個命令並檢查是否VS開始

devenv.exe /safemode 

這裏更多

http://blog.meidianto.com/2010/05/16/vs2010-tips-8-got-annoying-visual-studio-2010-error-try-to-run-in-safe-mode/

+1

呀,可惜它仍然發生在安全模式下,同樣的錯誤 – sovemp

+1

可能會嘗試修復/重新安裝VS ..這可能有助於..也可是你可以在這裏使用工具提交VS的錯誤.. http://blogs.msdn.com/b/visualstudio/archive/2012/06/20/the-visual-studio-2012-feedback-tool-a-better-way-to-submit-bugs.aspx – Amitd

+1

是的,我想我最終會這樣做,它現在不會崩潰或什麼,只是更多的煩惱。 – sovemp

4

VS需要管理員previleges處理插件。所以右擊VS並點擊「作爲管理員運行」。它解決了我。嘗試一次。

0

試試這個 工具 - >導入和導出設置 - >重置所有設置。

-1

爲您的VS版本下載web essentials。它排序我的問題有關ActivityLog.xml。 Web Essential

0

我有同樣的錯誤,我ActivityLog.xml顯示以下錯誤:

System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 1) No exports were found that match the constraint: ContractName Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator RequiredTypeIdentity Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator Resulting in: Cannot set import 'Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter.Import (ContractName="Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator")' on part 'Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter'. Element: Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter.Import (ContractName="Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator") --> Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition) at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part) at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part) at Microsoft.VisualStudio.Composition.NetFxAdapters.CompositionService.SatisfyImportsOnce(ComposablePart part) at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart) at Microsoft.Web.Editor.Composition.ComponentLocator`1.Import() at Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.LinterUtilities.<>c.<.cctor>b__4_1() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at System.Lazy`1.get_Value() at Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.LinterUtilities.IsFileSupported(String fileName) at Microsoft.VisualStudio.Web.Editor.Package.Lint.ErrorTagger.LintErrorTaggerProvider.CreateTagger[T](ITextBuffer textBuffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)

通過工具解決了這個問題 - >擴展和更新 - >更新 - > Visual Studio庫 - >安裝新版本Microsoft ASP.NET and Web Tools