-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
MAUI Blazor Windows App does not work with Native AOT #17713
Comments
Could you post the logs of what you're getting? Based on my memory of this, I think WinUI doesn't support some of those features (Ex. IL Trimming). Trying to run those commands in a standard WinUI 3 app I get this
Trying it with a MAUI Blazor app, I got the same errors. This is, most likely, an issue with WinUI that would need to be addressed. edit: Since I wanted to try it, WPF and WinForms don't support trimming so you couldn't use a BlazorWebView with those either. Also, not thinking about it, I was running this in Debug, when it should really be run in Release mode. Still fails there, though
This is with a WinUI3 project, fails the same way in MAUI (which, make sense, given that it uses it for its platform head). So yeah, unless I'm missing something, I think this is a WinUI issue. |
I figured I'd leave logs out in the initial issue coz I felt I was hitting a few different problems as I tried to add/remove the various AOT configurations, get rid of the other platforms, etc. Annoyingly I can't run it again so easily as I just tried to move to .NET 8 preview and try it there, but it doesn't work either (#17715). Am I mistaken that MAUI was meant to be officially supporting Native AOT? A question not exactly relevant to the issue - Is it possible to AOT compile just a C# library project within another C# project without having to treat it like a classic CPP library that requires bindings etc? |
The same error happens with net7.0 as it does with net8.0, I believe it has to do with the WinUI dependencies, less so the runtime (Although I could be wrong here) @jonathanpeppers @mattleibow Do ya'll have thoughts on this? Off the top of my head I don't know what's currently supported or not for the SDKs and the MAUI UI project itself. In terms of this specific issue, it does look like a WinUI one to me. |
If the error is related to "When will WindowsAppSdk support NativeAOT?" I think we will have to defer to the Windows team on this. |
If this is an issue with WASDK not supporting NativeAOT, then is it possible to open a new issue https://github.com/microsoft/WindowsAppSDK/issues |
Done. |
Duplicate of microsoft/WindowsAppSDK#3887 |
Thanks! I know the WASDK is working on better linking and AOT, so hopefully things get better soon. Right now, a WinUI app is huge. |
Description
I am currently developing an app with Avalonia on .NET 7 and I was curious to see if I could move to MAUI Blazor as it'd improve my productivity. I do not plan to release the app on anything but desktop platforms, and even then I may keep it to Windows.
It is important to me to have Native AOT. I got this working with Avalonia by adding the following to my csproj:
I installed the latest MAUI and created the default MAUI Blazor project in VS. I've attempted to apply the same or similar csproj settings, starting with just
<PublishAot>
and each step of the way the commandline publish has spit out errors. I cannot currently get it to work.How can I get the default start up project to publish to native AOT?
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: