Open KillyMXI opened 2 years ago
Enable compiled Bindings if you have not already. Often these help to debug.
https://docs.avaloniaui.net/docs/data-binding/compiledbindings
https://github.com/AvaloniaUI/AvaloniaVS/blob/f18343c6fbe8fed90b8d3743b8c21483818f2eeb/AvaloniaVS.Shared/Services/PreviewerProcess.cs#L444 - we should probably somehow expose the stack trace here as well.
The problem is that exception happens when XAML is already parsed and compiled into MSIL. So there is no reliable way to extract the line info at that point.
We might need to add debug information support for System.Reflection.Emit backend as well - https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/a263ywy6(v=vs.100)?redirectedfrom=MSDN
Describe the bug
During the app development there were few occasions when Axaml editor reports "Invalid Markup" errors, but they are actually not about markup and absolutely unhelpful to identify the actual cause, resulting in frustrating debugging sessions.
To Reproduce Steps to reproduce the behavior:
I can't give more condensed steps exactly because I don't know yet where the issue is. That's exactly what I'm complaining about.
Expected behavior
Error message or Avalonia Diagnostics entry that will be more helpful to pinpoint what exactly is missing. Better way of reporting errors in code-behind is needed.
All I got is that the error happened when evaluating
MainWindow.axaml
. If it can't be linked to a certain line in the axaml file, the error message text should include more information. The evaluator code should customize error messages it rethrows to be more specific.Screenshots
Desktop (please complete the following information):