Open d2dyno1 opened 3 weeks ago
A possible temporary workaround is to rename ResourceString.Name
to something else. It seems it's incorrectly treated as if it's an x:Name
This will be happening here https://github.com/unoplatform/uno/blob/e160f6b70a050d2aa125b663d1f4b3a1278c5f47/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs#L6222
We need to check for x:Name
(maybe FrameworkElement.Name
if we do generate a backing field for, I can't recall)
Current behavior
I'm using a custom MarkupExtension to localize strings from resources. It has a property
Name
which is used to retrieve resource IDs to translate. As of Uno 5.4.x I'm unable to build my app on maccatalyst, linux, and Windows due to failing XamlCodeGenerator.UnoApp54.zip
The issue appears to be hiding in Uno's
XamlFileGenerator
. I found references to the value I specified in the source-generated file which in turn does not have a declaring field.("XamlSourceGenFails" is a string that I used in the aforementioned markup extension's
Name
property)Expected behavior
The property value of the markup extension should neither be generated nor used by the source generator (see behavior on Uno 5.3.x)
How to reproduce it (as minimally and precisely as possible)
public string? Name { get; set; }
as well as override theProvideValue()
methodTextBlock
withText
using the markup extension and notice the issue does not appearStackPanel
withx:Name
andx:Load={x:Bind BoolPropertyThatIsTrueInCodeBehind, Mode=OneWay}
This was tested on maccatalyst and Linux X11
Workaround
No workaround has been found. The best option is to stick with Uno 5.3.x
Works on UWP/WinUI
Yes
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.SourceGenerationTasks, Other
NuGet package version(s)
No response
Affected platforms
Mac Catalyst, Skia (Linux X11)
IDE
Visual Studio 2022, Rider macOS
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
This bug is preventing me from migrating my app to the latest Uno version