Repository navigation
Closed
Labels
area-xamlXAML, CSS, Triggers, Behaviorsi/regressionThis issue described a confirmed regression on a currently supported versionpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidplatform/windowsregressed-in-11-preview1s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working
Milestone
Description
Description
Generated XAML creates a warning, for example: warning CS8622: Nullability of reference types... (actually this particular warning is pretty easy to figure out and resolve, but it's an easy example). The build emits an error, like:
1>H:\Develop\Bugs\XamlGeneration\XamlGeneration\obj\Debug\net10.0-windows10.0.19041.0\win-x64\intermediatexaml\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.XamlGenerator\MainPage.xaml.xsg.cs(143,21,143,37): warning CS8622: Nullability of reference types in type of parameter 'sender' of 'void MainPage.OnCounterClicked(object sender, EventArgs e)' doesn't match the target delegate 'EventHandler' (possibly because of nullability attributes).
But clicking on the error does noting because the file MainPage.xaml.xsg.cs cannot be found. Adding
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>To the project file does not help, so I guess there are two bugs:
- Displaying a message about a file then removing the file before the user can take action.
EmitCompilerGeneratedFilesset to true should retain the files whether or not they have warnings.
Steps to Reproduce
- Create a new MAUI app
- Edit
MainPage.xaml.csOnCounterClicked to specify the first parameter asobject senderby removing the "?" - Build it and observe the warning in the build output
I'm sure this (clicking on a warning) used to work in .NET 10 but I'm not sure if it ever worked in .NET11.
Link to public reproduction project repository
No response
Version with bug
11.0.0-preview.4
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.70
Affected platforms
Windows, Android, I was not able test on other platforms
Affected platform versions
Windows 11, Android SDK 35
Did you find any workaround?
No response
Relevant log output
Reacted by github-actions
Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, Behaviorsi/regressionThis issue described a confirmed regression on a currently supported versionpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidplatform/windowsregressed-in-11-preview1s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working
Activity
[-]Warnings From Generated XAML Refer toa file the IDE cannot find[/-][+]Warnings From Generated XAML Refer to a file the IDE cannot find[/+]NafeelaNazhir commentedon Jun 15, 2026
This issue has been validated in Visual Studio Code 1.124.0 with .NET MAUI versions 10.0.71 & net 11.0.0-preview1. It can be reproducible from net 11.0.0-preview1 and issue not reproduced in net 10.0.71 in Android platform.
XamlIssue.zip
david-maw commentedon Jul 3, 2026
Still seems to fail. In Visual Studio Insiders [11925.187] and SDK 11.0.100 preview 5. I see this:
Where double-clicking on the error updates the status line to: "The system cannot find the file specified".
[NET 11] Fix source-generated XAML diagnostic paths for ordinary and …
github-actions commentedon Oct 16, 2026
Closed by #39425 (merged to
net11.0). GitHub only auto-closes for PRs merged to the default branch; this issue was fixed by a PR merged to a non-default branch.david-maw commentedon Oct 19, 2026
I don't understand this closure, Testing in .NET 11 RC2 by inserting a single `FontSize="Large"`` clause in a default MAUI project gets me 6 warnings:
This looks like the same 3 warnings repeated twice and clicking on any of them does nothing. I am able to set
EmitCompilerGeneratedFilesto have intermediate files saved in an 'obj...generated' folder and the warnings in those ones at least are usefully clickable (theintermediatexamlones still are not). For the casual user I'd think knowing that "warning CS0612: 'Device' is obsolete" means "you used a named FontSize" is a bit obscure and IMHO generated code should never emit warnings - they should be suppressed in favor of a warning against the original source.