Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

Commented Unassigned: AtomicComposition encountered an unexpected Exception [14613]

$
0
0
Getting the following error occasionally


ProcessEntry() failed. InvalidOperationException: AtomicComposition encountered an unexpected Exception, review InnerException for details.
Stack Trace:
at System.ComponentModel.Composition.Hosting.AtomicComposition.FinalComplete()
at System.ComponentModel.Composition.Hosting.AtomicComposition.Complete()
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.DetermineRejection(ComposablePartDefinition definition, AtomicComposition parentAtomicComposition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.IsRejected(ComposablePartDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T](String contractName)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T]()

--------------------------Inner Exception--------------------------
AggregateException: One or more errors occurred.

NullReferenceException: Object reference not set to an instance of an object.
Stack Trace:
at Microsoft.Internal.Collections.WeakReferenceCollection`1.<CleanupDeadReferences>b__0(WeakReference w)
at System.Collections.Generic.List`1.RemoveAll(Predicate`1 match)
at Microsoft.Internal.Collections.WeakReferenceCollection`1.CleanupDeadReferences()
at Microsoft.Internal.Collections.WeakReferenceCollection`1.Add(T item)
at System.ComponentModel.Composition.Hosting.ImportEngine.StartSatisfyingImports(PartManager partManager, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ImportEngine.EngineContext.Complete()
at System.ComponentModel.Composition.Hosting.AtomicComposition.FinalComplete()

Comments: Hi I think my case it seems the error was related to a bad use of MEF in a multi thread environment. MEF isn't thread safe and this is what did cause those exception when GetExportedValue was called in the same time by 2 diff threads.. http://blogs.microsoft.co.il/bnaya/2010/12/04/dynamic-mef-isnt-thread-safe-by-nature/ http://blogs.microsoft.co.il/zuker/2011/01/02/mef-thread-safety-and-getexportedvalue/ I just had to add (isThreadSafe = true) to the CompositionContainer constructor. hope it helps.

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>