-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
Due to a missing attribute, resource files are generating warnings because they don't contain code comments for the classes.
Steps to Reproduce
- Create a new .NET MAUI project.
- Enable doc comments by adding:
<DocumentationFile>$(RootNamespace).xml</DocumentationFile> - Build and notice the generated warnings from the Styles.xaml and Colors.xaml files:
1>E:\Sources.tmp\MauiApp24\MauiApp24\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Colors.xaml.sg.cs(17,23,17,45): warning CS1591: Missing XML comment for publicly visible type or member '__TypeCAC680B4A8768504'
1>E:\Sources.tmp\MauiApp24\MauiApp24\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Colors.xaml.sg.cs(20,10,20,32): warning CS1591: Missing XML comment for publicly visible type or member '__TypeCAC680B4A8768504.__TypeCAC680B4A8768504()'
1>E:\Sources.tmp\MauiApp24\MauiApp24\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Styles.xaml.sg.cs(17,23,17,45): warning CS1591: Missing XML comment for publicly visible type or member '__TypeFD7F2A4CBEE8319A'
1>E:\Sources.tmp\MauiApp24\MauiApp24\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Styles.xaml.sg.cs(20,10,20,32): warning CS1591: Missing XML comment for publicly visible type or member '__TypeFD7F2A4CBEE8319A.__TypeFD7F2A4CBEE8319A()'
This happens because the class doesn't have the [GeneratedCode] attribute, but is only applied to the members of the class:
I do wonder if the GenerateCodeAttribute should be removed from the members and placed on the class instead?
Link to public reproduction project repository
No response
Version with bug
9.0.40 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
No response
Did you find any workaround?
Disable warnings, but that also means not getting warnings from missing comments from non-generated classes. When building class libraries, getting the comments added are important and thus the warning is important.
Relevant log output
Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
