We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

XamlParseException - Root element is missing.

When the Ribbon window is initializing, this exception occurs.


XamlParseException
Root element is missing.

   at System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext parserContext, XamlParseMode parseMode)


Inner Exception -
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xaml.XmlCompatibilityReader.Read()
   at MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
   at MS.Internal.Xaml.Parser.XamlScanner.Read()
   at MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__0.MoveNext()
   at MS.Internal.Xaml.NodeStreamSorter.StartNewNodeStreamWithSettingsPreamble()
   at MS.Internal.Xaml.NodeStreamSorter..ctor(XamlParserContext context, XamlPullParser parser, XamlXmlReaderSettings settings, Dictionary`2 xmlnsDictionary)
   at System.Xaml.XamlXmlReader.Initialize(XmlReader givenXmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings)
   at System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext parserContext, XamlParseMode parseMode)

2 Replies

JB Jeremy Branham June 1, 2015 03:39 AM UTC

It appears the "AutoPersist" setting in the Ribbon was throwing this error.
When I disabled it the app initialized correctly.
I'm assuming the state was corrupted.

Where does the Ribbon State get persisted?
How do we catch this type of exception?

Thanks!


SM Sugapriya Mariappan Syncfusion Team June 3, 2015 06:05 AM UTC

Hi Jeremy,

Thank you for contacting syncfusion support.

Query #1: Where does the Ribbon State get persisted?

In our Ribbon control when AutoPersist is set to True, the ribbon state will be saved in the below location as ‘.dat’ file format
Location: C:\Users\<UserName>\AppData\Local\IsolatedStorage\

Query #2: When the Ribbon window is initializing, Root element is missing exception occurs.

Could you please run your sample by deleting the ribbon state file from the above mentioned location ?
If you still facing the same issue, kindly get back us with replication steps.

Please let us know if you need any other assistance

Regards,
M.Sugapriya

Loader.
Live Chat Icon For mobile
Up arrow icon