What is Microsoft.Internal.Assumes.InternalErrorException?

已锁定 What is Microsoft.Internal.Assumes.InternalErrorException?

  • 2011年7月18日 18:31
     
     

    This exception has me scratching my head. Here's the actual text of the exception:

    {"Internal error occurred. Additional information: ''."}

    The source is: System.ComponentModel.Composition

    Target site: {Void Fail(System.String)}

    Here is the important part of the stack trace:

       at Microsoft.Internal.Assumes.Fail(String message)
       at Microsoft.Internal.Assumes.IsTrue(Boolean condition)
       at System.ComponentModel.Composition.Hosting.ImportEngine.InPrerequisiteLoop()
       at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
       at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
       at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart part)
       at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
       at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart 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.GetExportedValueFromLazy[T](Export export)
       at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedExportOfTM>b__1()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at System.Lazy`1.get_Value()

    The irony of the target site is not lost on me. Anyway, I have a List<Lazy<MyClass, MyInterface>> collection which is populated using [ImportMany]. I then use a LINQ query against this collection - the first time the query is executed, the assemblies are loaded. Most of the time, this works just fine, but every once in awhile this exception is thrown.

    I can't find any documentation at all about this exception. My best guess is that it is supposed to be purely internal and I shouldn't be seeing it - but that doesn't help at all, because I am seeing it. Has anyone seen an exception like this before, or does anyone have an idea where I would even start troubleshooting?

    I can't post the code directly, since it contains proprietary information, but I can create a generic version if it will help any. In any case, the majority of the time it works without any issue. Even if I am doing something spectacularly wrong, I can't imagine any situation where a LINQ to objects query should throw a bizarre exception like this...


    Check out My Blog for tech news, development tips, and other information for geeks like me.

全部回复

  • 2012年2月2日 21:15
     
     
    Did you find anything about it?