Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading load Xceed layouts #120

Closed
tchrobocek opened this issue Feb 3, 2020 · 3 comments
Closed

Loading load Xceed layouts #120

tchrobocek opened this issue Feb 3, 2020 · 3 comments

Comments

@tchrobocek
Copy link

Hello,

Recently we migrated from Xceed AvalonDock 3.1 and we have some problems with mapping to abstract classes during deserialization of XML. Is there a way to migrate those?

Here is a stack trace

System.InvalidOperationException: There is an error in XML document (32, 6). ---> System.InvalidOperationException: There is an error in XML document (32, 6). ---> System.InvalidOperationException: Instances of abstract classes cannot be created.

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderLayoutFloatingWindow.Read1_LayoutFloatingWindow()

--- End of inner exception stack trace ---

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.ReadElement(XmlReader reader)

at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.ReadElementList(XmlReader reader, Boolean isFloatingWindow)

at Xceed.Wpf.AvalonDock.Layout.LayoutRoot.ReadXml(XmlReader reader)

at System.Xml.Serialization.XmlSerializationReader.ReadSerializable(IXmlSerializable serializable, Boolean wrappedAny)

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderLayoutRoot.Read1_LayoutRoot()

--- End of inner exception stack trace ---

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)

at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(TextReader reader)

at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(String filepath)

at BroStudio.MainWindow.LoadLayout(Layout layout) in C:\Users\ted.pelikan\git\BroStudio\BroStudio\MainWindow.xaml.cs:line 72

at BroStudio.MainWindow.ApplicationLayouts_OnClick(Object sender, RoutedEventArgs e) in C:\Users\ted.pelikan\git\BroStudio\BroStudio\MainWindow.xaml.cs:line 91

at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)

at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

@Dirkster99
Copy link
Owner

Hi,

I am surprised there is a problem that would require a migration. Currently, there is no migration because there are no big changes - other than the fixes listed in the Readme.md and there is no breaking change I am aware of.

For the Stacktrace above it would be best if you could find a reference case using a test/demo program in this repository (start MLibTest, exit program, restart program should restore layout).

Otherwise, I am not sure what we could possibly do with your stacktrace :-( it might even be possible that you could generate the same stacktrace migrating to xceed version 3.6 (which is very similar plus fixes and additional features).

@tchrobocek
Copy link
Author

I just found that it's probably the same issue as #59

Weird thing is sometimes I get exception as above; e.g. "cannot deserialize abstract classes" and sometimes "Collection was modified; enumeration operation may not execute.".

For now I resolved the issue with downgrade to 3.5.4.1. But the 3.5.5 and newer does not work.

@Dirkster99
Copy link
Owner

@tchrobocek Would you be able to review the actual change and maybe come up with resolution? I cannot verify this issue or Issue #59 which makes it next to impossible for me to fix this.

I am also wondering if there is something specific to the controls you are using(?).
I can imagine that one of your controls might (by accident) block the UI thread and so things might get out of sync(?). Can you retest your layout but just load a dummy TextBlock or such instate of the actual controls?

Otherwise, I have no idea what to do with this or Issue #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants