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

Facing exception in layout deserialization #440

Closed
Shujee opened this issue May 16, 2023 · 0 comments
Closed

Facing exception in layout deserialization #440

Shujee opened this issue May 16, 2023 · 0 comments

Comments

@Shujee
Copy link

Shujee commented May 16, 2023

This has been reported before, but that issue has been closed more than 3 years ago, so I'm reporting it here as a new issue.

I'm facing this problem when deserializing a layout. The exact exception is:

System.InvalidOperationException
  HResult=0x80131509
  Message=There is an error in XML document (68, 4).
  Source=System.Xml
  StackTrace:
   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 BD_Desktop.MainWindow._Lambda$__5-2(ApplicationMessage`1 m) in F:\Desktop\David\XPressBadgeWPF\BD_Desktop\MainWindow.xaml.vb:line 48

  This exception was originally thrown at this call stack:
    System.Xml.XmlReader.ReadEndElement()
    Xceed.Wpf.AvalonDock.Layout.LayoutRoot.ReadXml(System.Xml.XmlReader)
    System.Xml.Serialization.XmlSerializationReader.ReadSerializable(System.Xml.Serialization.IXmlSerializable, bool)
    <Unknown Method>

Inner Exception 1:
XmlException: 'Element' is an invalid XmlNodeType. Line 68, position 4.

I'm using the latest NuGet package I guess (4.5). Here is the XML file:

<?xml version="1.0" encoding="utf-8"?>
<LayoutRoot>
  <RootPanel Orientation="Horizontal">
    <LayoutAnchorablePane Id="9e430c07-0361-451c-9d39-87bb3aab641f" DockWidth="477" FloatingWidth="485" FloatingHeight="628" FloatingLeft="-224" FloatingTop="562" />
    <LayoutAnchorablePane Id="51f7c345-717b-403b-a0d0-643f4edc8640" DockWidth="477" FloatingWidth="485" FloatingHeight="628" FloatingLeft="-378" FloatingTop="561" />
    <LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="234">
      <LayoutAnchorablePane DockWidth="234" FloatingWidth="811" FloatingHeight="803" FloatingLeft="-376" FloatingTop="576">
        <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Toolbox" IsSelected="True" ContentId="ToolboxTool" FloatingLeft="-376" FloatingTop="576" FloatingWidth="811" FloatingHeight="803" CanClose="False" LastActivationTimeStamp="11/08/2017 09:40:10" />
      </LayoutAnchorablePane>
      <LayoutAnchorablePaneGroup Orientation="Horizontal" FloatingWidth="811" FloatingHeight="803" FloatingLeft="-302" FloatingTop="599">
        <LayoutAnchorablePane FloatingWidth="811" FloatingHeight="803" FloatingLeft="-302" FloatingTop="599">
          <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Drawing Explorer" IsSelected="True" ContentId="ExplorerTool" FloatingLeft="-302" FloatingTop="599" FloatingWidth="811" FloatingHeight="803" CanClose="False" LastActivationTimeStamp="05/15/2023 07:22:08" />
          <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Action History" ContentId="ActionHistoryTool" FloatingLeft="-283" FloatingTop="777" FloatingWidth="811" FloatingHeight="803" CanClose="False" LastActivationTimeStamp="11/08/2017 09:40:27" />
        </LayoutAnchorablePane>
      </LayoutAnchorablePaneGroup>
    </LayoutAnchorablePaneGroup>
    <LayoutPanel Orientation="Vertical">
      <LayoutDocumentPane Id="2728727f-f317-401f-9d88-8ee139df1056" />
      <LayoutAnchorablePaneGroup Orientation="Horizontal" DockHeight="143.5" FloatingWidth="485" FloatingHeight="628" FloatingLeft="730" FloatingTop="639">
        <LayoutAnchorablePane DockHeight="143.5" FloatingWidth="485" FloatingHeight="628" FloatingLeft="730" FloatingTop="639">
          <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Assets Library" IsSelected="True" ContentId="AssetsLibraryTool" FloatingLeft="730" FloatingTop="639" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="11/08/2017 09:46:07" />
        </LayoutAnchorablePane>
      </LayoutAnchorablePaneGroup>
    </LayoutPanel>
    <LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="344">
      <LayoutAnchorablePane DockWidth="344" DockHeight="1.54373627411623*" FloatingWidth="840" FloatingHeight="1010" FloatingLeft="840">
        <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Properties" IsSelected="True" ContentId="PropertiesTool" FloatingLeft="840" FloatingWidth="840" FloatingHeight="1010" CanClose="False" LastActivationTimeStamp="11/08/2017 09:44:40" />
        <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Duplicate Transform" ContentId="DuplicateTransformTool" FloatingLeft="1225" FloatingTop="384" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="11/08/2017 09:44:38" />
      </LayoutAnchorablePane>
      <LayoutAnchorablePane DockHeight="1.10532032965735*" FloatingWidth="485" FloatingHeight="628" FloatingLeft="1267" FloatingTop="604">
        <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Color Box" IsSelected="True" ContentId="ColorBoxTool" FloatingLeft="1267" FloatingTop="604" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="11/08/2017 09:43:43" />
      </LayoutAnchorablePane>
    </LayoutAnchorablePaneGroup>
    <LayoutAnchorablePane Id="425bc1b3-0284-4edc-b1ec-94b572db0894" DockWidth="477" FloatingWidth="840" FloatingHeight="1010" FloatingLeft="840" />
  </RootPanel>
  <TopSide />
  <RightSide>
    <LayoutAnchorGroup PreviousContainerId="425bc1b3-0284-4edc-b1ec-94b572db0894">
      <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Page Setup" ContentId="PageSetupTool" FloatingLeft="840" FloatingWidth="840" FloatingHeight="1010" CanClose="False" LastActivationTimeStamp="11/08/2017 09:43:53" />
    </LayoutAnchorGroup>
  </RightSide>
  <LeftSide>
    <LayoutAnchorGroup PreviousContainerId="51f7c345-717b-403b-a0d0-643f4edc8640">
      <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Data Source" ContentId="DataSourceSelectorTool" FloatingLeft="-378" FloatingTop="561" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="11/08/2017 09:42:10" />
    </LayoutAnchorGroup>
    <LayoutAnchorGroup PreviousContainerId="9e430c07-0361-451c-9d39-87bb3aab641f">
      <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Data Preview" ContentId="DataPreviewTool" FloatingLeft="-224" FloatingTop="562" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="11/08/2017 09:42:22" />
    </LayoutAnchorGroup>
  </LeftSide>
  <BottomSide />
  <FloatingWindows>
    <LayoutAnchorableFloatingWindow>
      <LayoutAnchorablePaneGroup Orientation="Horizontal" FloatingWidth="485" FloatingHeight="628" FloatingLeft="742" FloatingTop="239">
        <LayoutAnchorablePane Id="c86b719e-3231-4700-964c-f20564e3dfb2" FloatingWidth="485" FloatingHeight="628" FloatingLeft="742" FloatingTop="239" />
      </LayoutAnchorablePaneGroup>
    </LayoutAnchorableFloatingWindow>
    <LayoutAnchorableFloatingWindow>
      <LayoutAnchorablePaneGroup Orientation="Horizontal" FloatingWidth="241" FloatingHeight="221" FloatingLeft="355" FloatingTop="537">
        <LayoutAnchorablePane Id="0c28da3a-7e37-428e-acd1-d19af9e5fefe" FloatingWidth="241" FloatingHeight="221" FloatingLeft="355" FloatingTop="537" />
      </LayoutAnchorablePaneGroup>
    </LayoutAnchorableFloatingWindow>
  </FloatingWindows>
  <Hidden>
    <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Album" IsSelected="True" ContentId="AlbumTool" FloatingLeft="474" FloatingTop="164" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="05/15/2023 07:22:07" PreviousContainerId="2728727f-f317-401f-9d88-8ee139df1056" PreviousContainerIndex="1" />
    <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Photos" IsSelected="True" ContentId="PhotosTool" FloatingLeft="742" FloatingTop="239" FloatingWidth="485" FloatingHeight="628" CanClose="False" LastActivationTimeStamp="05/15/2023 07:22:07" PreviousContainerId="c86b719e-3231-4700-964c-f20564e3dfb2" PreviousContainerIndex="0" />
    <LayoutAnchorable AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Photo Capture" IsSelected="True" ContentId="CamCaptureTool" FloatingLeft="355" FloatingTop="537" FloatingWidth="241" FloatingHeight="221" CanClose="False" LastActivationTimeStamp="05/15/2023 07:22:07" PreviousContainerId="0c28da3a-7e37-428e-acd1-d19af9e5fefe" PreviousContainerIndex="0" />
  </Hidden>
  <AssetsLibraryTool></AssetsLibraryTool>
  <DuplicateTransformTool></DuplicateTransformTool>
  <PageSetupTool></PageSetupTool>
  <DataPreviewTool></DataPreviewTool>
  <DataSourceSelectorTool></DataSourceSelectorTool>
  <ActionHistoryTool></ActionHistoryTool>
  <PropertiesTool></PropertiesTool>
  <ColorBoxTool></ColorBoxTool>
  <ExplorerTool></ExplorerTool>
  <ToolboxTool></ToolboxTool>
</LayoutRoot>
@Shujee Shujee closed this as completed May 22, 2023
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

1 participant