Hi.
Unfortunately another issue has now arisen with the main application.
Using hcdDefaultDomain causes the following exception if the plugin is Loaded / Released / Unloaded, then loaded again.
Changing to NewAppDomain we can load/reload, but the crash occurs. Nothing’s ever simple is it !
2020-06-15 14:03:33.9792|INFO|DonorManagementPlugin.PluginContainer|Starting Donor Application
2020-06-15 14:03:33.9792|INFO|DonorManagementPlugin.PluginContainer|Starting IMetricsService
2020-06-15 14:03:33.9792|INFO|DonorManagementPlugin.PluginContainer|Started IMetricsService
2020-06-15 14:03:33.9956|INFO|DonorManagementPlugin.PluginContainer|Applying theme
2020-06-15 14:03:33.9956|INFO|DonorManagementPlugin.PluginContainer|Calling InitializeComponent
2020-06-15 14:03:34.0729|ERROR|DonorManagementPlugin.PluginContainer|An unhandled exception occurred: 'Add value to collection of type 'DevExpress.Mvvm.UI.Interactivity.BehaviorCollection' threw an exception.' Line number '14' and line position '44'.
2020-06-15 14:03:34.0729|ERROR|DonorManagementPlugin.PluginContainer|System.Windows.Markup.XamlParseException: 'Add value to collection of type 'DevExpress.Mvvm.UI.Interactivity.BehaviorCollection' threw an exception.' Line number '14' and line position '44'. ---> WpfBindingErrors.BindingException: System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=; DataItem='NavigationFrame' (Name='nfFrame'); target element is 'FrameNavigationService' (HashCode=45706078); target property is 'Frame' (type 'NavigationFrame')
at WpfBindingErrors.BindingExceptionThrower.OnErrorCatched(String message)
at WpfBindingErrors.ObservableTraceListener.WriteLine(String message)
at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at MS.Internal.AvTrace.Trace(TraceEventType type, Int32 eventId, String message, String[] labels, Object[] parameters)
at MS.Internal.TraceData.Trace(TraceEventType type, AvTraceDetails traceDetails, Object p1)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.OnInheritanceContextChanged(Object sender, EventArgs e)
at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at MS.Internal.InheritanceContextChangedEventManager.OnInheritanceContextChanged(Object sender, EventArgs args)
at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)
at System.Windows.Freezable.AddInheritanceContext(DependencyObject context, DependencyProperty property)
at System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at DevExpress.Xpf.WindowsUI.Navigation.FrameNavigationService.OnActualFrameChanged(NavigationFrame oldValue, NavigationFrame newValue)
at DevExpress.Xpf.WindowsUI.Navigation.FrameNavigationService.set_ActualFrame(NavigationFrame value)
at DevExpress.Xpf.WindowsUI.Navigation.FrameNavigationService.OnFrameChanged(NavigationFrame oldValue, NavigationFrame newValue)
at DevExpress.Xpf.WindowsUI.Navigation.FrameNavigationService.OnFrameChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.OnInheritanceContextChanged(Object sender, EventArgs e)
at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at MS.Internal.InheritanceContextChangedEventManager.OnInheritanceContextChanged(Object sender, EventArgs args)
at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)
at System.Windows.Freezable.AddInheritanceContext(DependencyObject context, DependencyProperty property)
at System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)
at System.Windows.Freezable.OnFreezablePropertyChanged(DependencyObject oldValue, DependencyObject newValue, DependencyProperty property)
at System.Windows.FreezableCollection`1.AddWithoutFiringPublicEvents(T value)
at System.Windows.FreezableCollection`1.AddHelper(T value)
at System.Windows.FreezableCollection`1.System.Collections.IList.Add(Object value)
at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)
--- End of inner exception stack trace ---
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at DonorManagementPlugin.PluginContainer.InitializeComponent()
at DonorManagementPlugin.PluginContainer..ctor()