Cannot access a disposed Object in Prism Mef

Feb 4, 2014 at 1:26 PM
Hi ,

When I am trying to load the view from the container, it throwing the exception like below, but it was not reproducible again.

Can any one pls help me regarding this issue ?






Timestamp: 2/4/2014 12:13:50 PM
      Message: HandlingInstanceID: c39d0171-4f5f-40ab-9c24-a1bb5732eb7d

An exception of type 'System.ComponentModel.Composition.CompositionException' occurred and was caught.

02/04/2014 04:13:50
Type : System.ComponentModel.Composition.CompositionException, System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Cannot access a disposed object.
Object name: 'System.ComponentModel.Composition.Hosting.CompositionContainer'.

Resulting in: Activation error occured while trying to get instance of type DelayedRegionCreationBehavior, key ""

Resulting in: Set property 'Microsoft.Practices.Prism.Regions.RegionManager.RegionName' threw an exception.

Resulting in: An exception occurred while trying to create an instance of type 'VCA.Sparky.Modules.EMR.Views.ExamFindingsView'.

Resulting in: Cannot activate part 'VCA.Sparky.Modules.EMR.Views.ExamFindingsView'.
Element: VCA.Sparky.Modules.EMR.Views.ExamFindingsView --> VCA.Sparky.Modules.EMR.Views.ExamFindingsView --> AssemblyCatalog (Assembly="VCA.Sparky.Modules.EMR, Version=2.27.14034.13, Culture=neutral, PublicKeyToken=null")

Resulting in: Cannot get export 'VCA.Sparky.Modules.EMR.Views.ExamFindingsView (ContractName="VCA.Sparky.Modules.EMR.Views.IExamFindingsView")' from part 'VCA.Sparky.Modules.EMR.Views.ExamFindingsView'.
Element: VCA.Sparky.Modules.EMR.Views.ExamFindingsView (ContractName="VCA.Sparky.Modules.EMR.Views.IExamFindingsView") --> VCA.Sparky.Modules.EMR.Views.ExamFindingsView --> AssemblyCatalog (Assembly="VCA.Sparky.Modules.EMR, Version=2.27.14034.13, Culture=neutral, PublicKeyToken=null")

Resulting in: Cannot set import 'VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel..ctor (Parameter="view", ContractName="VCA.Sparky.Modules.EMR.Views.IExamFindingsView")' on part 'VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel'.
Element: VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel..ctor (Parameter="view", ContractName="VCA.Sparky.Modules.EMR.Views.IExamFindingsView") --> VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel --> AssemblyCatalog (Assembly="VCA.Sparky.Modules.EMR, Version=2.27.14034.13, Culture=neutral, PublicKeyToken=null")

Resulting in: Cannot get export 'VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel (ContractName="VCA.Sparky.Modules.EMR.ViewModels.IExamFindingsViewModel")' from part 'VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel'.
Element: VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel (ContractName="VCA.Sparky.Modules.EMR.ViewModels.IExamFindingsViewModel") --> VCA.Sparky.Modules.EMR.ViewModels.ExamFindingsViewModel --> AssemblyCatalog (Assembly="VCA.Sparky.Modules.EMR, Version=2.27.14034.13, Culture=neutral, PublicKeyToken=null")

Source : System.ComponentModel.Composition
Help link :
Errors : System.Collections.ObjectModel.ReadOnlyCollection1[System.ComponentModel.Composition.CompositionError]
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Object GetExportedValueFromComposedPart(System.ComponentModel.Composition.Hosting.ImportEngine, System.ComponentModel.Composition.Primitives.ComposablePart, System.ComponentModel.Composition.Primitives.ExportDefinition)
Stack Trace : at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
at VCA.Sparky.Modules.EMR.Controller.EMRController.ExamFindingsLoadEventHandler(MedicalNoteArgs args) in c:\Builds\7\Spike\Woofware\Sources\Woofware\VCA.Sparky\Modules\VCA.Sparky.Modules.EMR\Controller\EMRController.cs:line 193
at Microsoft.Practices.Prism.Events.EventSubscription
1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
at VCA.Sparky.Modules.Client.Controller.ClientController.LoadExamFindings(Patient pet) in c:\Builds\7\Spike\Woofware\Sources\Woofware\VCA.Sparky\Modules\VCA.Sparky.Modules.Client\Controller\ClientController.cs:line 5553
at VCA.Sparky.Modules.Client.ViewModels.ClientPanelViewModel.PetMenuSelectionChangedCommandHandler(PatientMenuItem item) in c:\Builds\7\Spike\Woofware\Sources\Woofware\VCA.Sparky\Modules\VCA.Sparky.Modules.Client\ViewModels\ClientPanelViewModel.cs:line 1162
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)




Thanks and regards,
Sivalingam