XAML Parsing Exception Messages are not Useful #3163
Labels
area-ErrorHandling
Issues related to error reporting and debugging
area-Parser
product-winui3
WinUI 3 issues
team-Markup
Issue for the Markup team
I was asked to open an issue by @stevenbrix when I mentioned this over on the August 19th community call announcement. Note that in my case, I was creating WinUI Desktop applications.
I find the XAML Parsing exception messages to be near useless when trying to correct parsing mistakes. I have an extensive background in WPF application development so its not as if I am new to using XAML.
While trying to port a small subset of XAML libraries over to WinUI, not a single exception message has been useful in helping me resolve my problems. Although I have not been logging a tally of those, the following example is typical of what I have encountered.
Example of Error Messages for a simple XAML Error
Take for example the mistake that I made when defining a XAML StaticResource for the type "Double". I thought that I could add a using for System and then define the resource with sys:Double. As you can see from the exception message below, it would be extremely difficult to know what type of XAML parsing error had occurred. It doesn't even point to the assembly that actually caused the error let alone have a warm hint of what the problem was. When issues like this occur, I have to start backing out each and every block of XAML until the code runs without exception. Since it takes much longer to launch a packaged application, its a very tedious, time consuming and error prone process.
Writing raw XAML is error prone, but when porting hundreds of XAML files from WPF, errors are unavoidable. My mistake was using sys:Double instead of x:Double.
The text was updated successfully, but these errors were encountered: