-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorss/needs-attentionIssue has more information and needs another lookIssue has more information and needs another lookt/bugSomething isn't workingSomething isn't workingxsgXaml sourceGenXaml sourceGen
Milestone
Description
Description
Using the latest .NET10-rc1 , and trying out the xaml source gen in a new .net MAUI app, I have these errors:
Severity Code Description Project File Line Suppression State
Error (active) CS8795 Partial method '__Type08BAD333D93A1098.InitializeComponent()' must have an implementation part because it has accessibility modifiers. Maui10Preview7 (net10.0-android) C:\P\net9-repros\Maui10Preview7\obj\Debug\net10.0-android\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Colors.xaml.sg.cs 26
Severity Code Description Project File Line Suppression State
Error (active) CS8795 Partial method '__Type3F0379CBCFA4A406.InitializeComponent()' must have an implementation part because it has accessibility modifiers. Maui10Preview7 (net10.0-android) C:\P\net9-repros\Maui10Preview7\obj\Debug\net10.0-android\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Styles.xaml.sg.cs 26
where the culprits are the Colors.xml files and Styles.xml files ( default )
In order to enable the source gen I applied this:
<MauiXamlInflator>SourceGen</MauiXamlInflator>
On my .csproj
Steps to Reproduce
- Clone https://github.com/bcaceiro/net9-repros/tree/main/Maui10Preview7
- Build
- See errors
Link to public reproduction project repository
https://github.com/bcaceiro/net9-repros/tree/main/Maui10Preview7
Version with bug
10.0.0-rc.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Not using the feature :)))))
Relevant log output
1>------ Build started: Project: Maui10Preview7, Configuration: Debug Any CPU ------
1>C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>Including assemblies for Hot Reload support
1>C:\P\net9-repros\Maui10Preview7\obj\Debug\net10.0-android\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Colors.xaml.sg.cs(26,24,26,43): error CS8795: Partial method '__Type08BAD333D93A1098.InitializeComponent()' must have an implementation part because it has accessibility modifiers.
1>C:\P\net9-repros\Maui10Preview7\obj\Debug\net10.0-android\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\Resources_Styles_Styles.xaml.sg.cs(26,24,26,43): error CS8795: Partial method '__Type3F0379CBCFA4A406.InitializeComponent()' must have an implementation part because it has accessibility modifiers.
1>Done building project "Maui10Preview7.csproj" -- FAILED.Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorss/needs-attentionIssue has more information and needs another lookIssue has more information and needs another lookt/bugSomething isn't workingSomething isn't workingxsgXaml sourceGenXaml sourceGen
Type
Projects
Status
Done