XamlX
XamlX copied to clipboard
Winfx schema version 2009 is failing
During the migration from Xamarin to Avalonia I experienced this issue:
When I keep using the 2009 reference (as it was working fine in the Xamarin project) xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
it throws CSC : error AXN0002: XamlX.XamlParseException: Unable to resolve type Static from namespace http://schemas.microsoft.com/winfx/2009/xaml
When "downgrading" to xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
it works.
The failing statement that produces the error is this: Text="{x:Static common:Statics.ApplicationTitle}"
BTW: Every time a XamlX error comes up it tells me the line and position but it does not tell me which file is failing. Shall I file an extra issue for this or is there a solution that the file is also printed with the error message?
(Just as additional information)
I experienced another situation during my migration that is also related to the same issue (when version 2009 is used):
[...]Page.xaml(26,2,26,2): Avalonia error XAMLIL: Unable to find emitter for node type: XamlX.Ast.XamlAstXmlDirective
When switching back to 2006 it worked again.
So, there is not only an issue with the x:Static statement, I saw that it fails also on an empty UserControl XAML file.
https://github.com/AvaloniaUI/Avalonia/issues/3759#issuecomment-1702262494
@tisis2 please create a new issue/discussion in Avalonia repo with your minimal sample that can be built and tested. It doesn't seem that your problem is related to 2009 schema from this issue.