XamlX icon indicating copy to clipboard operation
XamlX copied to clipboard

Winfx schema version 2009 is failing

Open topeterk opened this issue 2 years ago • 3 comments

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?

topeterk avatar Jul 30 '22 22:07 topeterk

(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.

topeterk avatar Jul 31 '22 22:07 topeterk

https://github.com/AvaloniaUI/Avalonia/issues/3759#issuecomment-1702262494

tisis2 avatar Oct 31 '23 11:10 tisis2

@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.

maxkatz6 avatar Oct 31 '23 12:10 maxkatz6