You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
Since #22 and #23 are merged, and 0.2.0-preview is shipped to NuGet, the generator will warn folks when classes inheriting from the Avalonia.INamed interface cannot be processed. If folks tend to write custom controls without XAML files, e.g. they are binding from code or applying tiny fixes, the generator currently writes the following warnings to console:
CSC : warning AXN0003: The type ExampleView should be declared with the 'partial' keyword as it is either annotated with the [GenerateTypedNameReferences] attribute, or the <AvaloniaNameGenerator> property is set to 'true' in the C# project file (it is set to 'true' by default). In order to skip the processing of irrelevant files, put <AvaloniaNameGenerator>false</AvaloniaNameGenerator> into your .csproj file as <PropertyGroup> descendant and decorate only relevant view classes with the [GenerateTypedNameReferences] attribute.
This happens if we add a similar class to a project with XamlNameReferenceGenerator installed, and don't add a XAML file for it:
publicclassExampleView:UserControl{}
So if we add ten classes, we'll get ten warnings, and this can be pretty annoying. Currently, the solution is to put to .csproj:
and to decorate only relevant classes with [GenerateTypedNameReferences] explicitly as stated in README.md https://github.com/AvaloniaUI/Avalonia.NameGenerator#usage-opt-in But probably worth introducing additional MSBuild option e.g. <AvaloniaNameGeneratorWarnings>false</AvaloniaNameGeneratorWarnings> e.g. if this property is set to false, then the source generator will silently skip the classes without XAML files without printing the warnings. Worth leaving the warnings enabled by default because they can help in discovering bugs.
The text was updated successfully, but these errors were encountered:
Since #22 and #23 are merged, and
0.2.0-preview
is shipped to NuGet, the generator will warn folks when classes inheriting from theAvalonia.INamed
interface cannot be processed. If folks tend to write custom controls without XAML files, e.g. they are binding from code or applying tiny fixes, the generator currently writes the following warnings to console:CSC : warning AXN0003: The type ExampleView should be declared with the 'partial' keyword as it is either annotated with the [GenerateTypedNameReferences] attribute, or the <AvaloniaNameGenerator> property is set to 'true' in the C# project file (it is set to 'true' by default). In order to skip the processing of irrelevant files, put <AvaloniaNameGenerator>false</AvaloniaNameGenerator> into your .csproj file as <PropertyGroup> descendant and decorate only relevant view classes with the [GenerateTypedNameReferences] attribute.
This happens if we add a similar class to a project with
XamlNameReferenceGenerator
installed, and don't add a XAML file for it:So if we add ten classes, we'll get ten warnings, and this can be pretty annoying. Currently, the solution is to put to
.csproj
:and to decorate only relevant classes with
[GenerateTypedNameReferences]
explicitly as stated in README.md https://github.com/AvaloniaUI/Avalonia.NameGenerator#usage-opt-in But probably worth introducing additional MSBuild option e.g.<AvaloniaNameGeneratorWarnings>false</AvaloniaNameGeneratorWarnings>
e.g. if this property is set to false, then the source generator will silently skip the classes without XAML files without printing the warnings. Worth leaving the warnings enabled by default because they can help in discovering bugs.The text was updated successfully, but these errors were encountered: