question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How to fix XML Exception when loading XAML with WinUI ?

See original GitHub issue

Hello, I have an issue since about three days that affects the developement of my application. When I load my XAML page, I get an Xml unhandled exception : image Here is the precise error.

System.Xml.XmlException
Données non valides au niveau racine. Ligne 1, position 1.
   à System.Xml.XmlTextReaderImpl.Throw(Exception e)
   à System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   à System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   à System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   à System.Xml.XmlTextReaderImpl.Read()
   à System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   à System.Xml.XmlDocument.Load(XmlReader reader)
   à Microsoft.VisualStudio.DesignTools.UwpDesignerHost.Utility.PackageManifestUpdater..ctor(String manifestPath)
   à Microsoft.VisualStudio.DesignTools.UwpDesignerHost.ShadowCopy.AppxRecipeShadowCopyWorker.<>c__DisplayClass25_0.<CopyProjectContentAsync>b__0()
   à System.Threading.Tasks.Task.InnerInvoke()
   à System.Threading.Tasks.Task.Execute()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.<EnsureProjectPayloadAsync>d__35.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.UwpDesignerHost.UwpHostPlatform.<EnsureProjectPayloadAsync>d__21.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.<EnsureShadowCacheContent>d__27.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.<CreateSurfaceProcessAsync>d__26.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.SurfaceProcessContext.<EnsureSurfaceProcessAsyncCore>d__104.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.SurfaceProcessContext.<EnsureSurfaceProcessAsyncInternal>d__102.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à Microsoft.VisualStudio.DesignTools.XamlSurfaceDesigner.Views.IsolatedSurfaceImageHost.<CreateSurfaceAsync>d__66.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

System.AggregateException
Une ou plusieurs erreurs se sont produites.

When I load the XAML Designer without WinUI controls, it don’t crash. I tried to reinstall the package but nothing has changed. Thank you very much in advance !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Osaxelycommented, Dec 23, 2020

Ok I’m trying and will tell you if that’s worked

0reactions
ranjeshjcommented, Jan 6, 2021

Looks like the issue is resolved. If you have a consistent repro or see it again, please activate. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Faulting Module: microsoft.ui.xaml.dll - Microsoft Q&A
When I'm trying to run my WinUI 3 app, I get this error in Event Viewer: Log Name: Application Source: Application Error Date:...
Read more >
WinUI3 App Throws Exception - What Have I Missed?
1). Try to use SFC tool to repair missing or corrupted system files. 2). Check if there is any error recorded for Windows...
Read more >
Cannot build Xaml in Platforms/Windows folder
In my MAUI project, I want to design xaml for different platforms seperately, but xaml file in Platform/Windows folder cannot compile.
Read more >
Unable to open Model.DesignedDiffs.xaml as it opens up ...
Hi I am having issues opening the Model.DesignedDiffs.xaml as it opens up as XML. I have followed all the steps in the following...
Read more >
After updating VS 2019 to version 16.8.4, go the error ...
On loading VS today I got this error message: There was an error activating the remote language server, C#/Visual Basic Language Server ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found