-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Generators: "CompileXaml" task fails when using source generators in WinUI 3 Project #46300
Comments
At a glance I believe this is an issue in the WinUI build pipeline. Seems that when they're building their intermediate assembly (for type inspection) they're not including the source generators in that compilation request and hence the compilation is incomplete. Think they need to change their process to include source generators. |
Interesting, the issue is because we explicitly disable analyzers from running during We can obviously fix it by turning on analyzers in pre-compile, but I assume these were disabled for perf reasons. @mavasani or @rainersigwald any recollection on this one? Looks like its been this way for some time. I wonder if we need to add another flag that says 'run generators, but not analyzers' :( at that point we lose a lot of the free infra we got from re-using all the analyzer mechanisms directly, and I start to wonder if we should just have a dedicated |
@KaiDevelopment as a temporary workaround you can add |
Also adding @KirillOsenkov who initially identified the issue #1622. I am not sure what is a good solution here.. |
Analyzers should be disabled here, but I think source generators should not. An analyzer not running will not break your build but a source generator failing to run will. |
Yes, we discussed this offline and we will add a compiler switch to allow skipping only analyzers. |
@chsienki: Thank you, it's working great. I'll close this issue as a permanent solution is coming. |
@mavasani. Was a permanent solution ever shipped? I'm hitting this issue with WinUI3 and the new C#/Win32 generators, and wondering what workaround to apply. |
Version Used:
Windows Version 2004 (Build 19041.388)
dotnet 5.0.100-preview.7.20366.6
Microsoft Visual Studio Enterprise 2019 Preview Version 16.7.0 Preview 5.0
WinUI 3.0.0-preview2.200713.0
Steps to Reproduce:
MainWindow.xaml.cs
:Expected Behavior:
Project build should succeed.
Actual Behavior:
Build fails with the following errors:
Additional Information
The error only occures when you directly call the generated method:
Replacing
with
allows the project to compile without error and show the correct text in the
ContentDialog
.The text was updated successfully, but these errors were encountered: