-
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
Updating Maui templates to build unpackaged Windows apps by default #23787
Updating Maui templates to build unpackaged Windows apps by default #23787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that our template tests assume everything is a packaged app so we need to update them accordingly and make sure we are testing packaged apps.
Since the default and primary way was packaged, we need to probably make sure we have all of the tests like before, but now explicitly packaged.
443919c
to
199cd36
Compare
src/Templates/src/templates/maui-multiproject/MauiApp.1.WinUI/MauiApp.1.WinUI.csproj
Outdated
Show resolved
Hide resolved
199cd36
to
f185948
Compare
f185948
to
906b2a3
Compare
906b2a3
to
2efb5b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thanks for catching that! |
…ev/lukewest/main/TemplateWindowsUnpackaged
# Conflicts: # eng/pipelines/common/maui-templates.yml
…dowsUnpackaged # Conflicts: # src/TestUtils/src/Microsoft.Maui.IntegrationTests/WindowsTemplateTest.cs
…ev/lukewest/main/TemplateWindowsUnpackaged
BTW: We tried to migrate to the unpackaged mode as well but we reverted back to the packaged mode. The reason was that in unpackaged apps, one cannot use file pickers under admin accounts (an exception is thrown). I mention it here just as a warning what this entails. For more details, #20830 which mentions the underlying issue microsoft/WindowsAppSDK#2504. |
^^ I ran into the above issue as well, a long time ago with this app: We were just trying to use unpackaged mode to simplify sharing the app in a |
This change worries me. Thinks like app redirection that is required for oauth authentication, or application settings and secure storage won't work in unpackaged, just to mention a couple. @MartyIX points out another issue. |
I really concerned about this decision, Using Unpackaged by Default does comes with lots of limitations and mostly new devs that coming from other cross platform mobile app Frameworks won't understand why most of the API's don't work on Windows when it is UnPackaged. |
When I saw the link to the PR I thought (and hoped) it would still a draft and that we could have a nice discussion before it went through. I'm really concerned by this change, for several reasons:
I'm personally concerned with respect to the last point in particular. Especially with the recent push for "security above all else", how does that fit in with this change effectively pushing developers further away from AppContainer and from running in a sandboxed environment? The change I'd have liked to see would've been to enable AppContainer by default. I understand that might've introduced friction, and just leaving full trust MSIX could've been a good enough compromise for now. But this is just the complete opposite end of the spectrum and makes all app not just always run as full trust, but without even a package nor the minimal virtualization that MSIX provides by default for Centennial (Win32) apps 🥲 |
@Sergio0694 hey let's have a chat soon with @BethMassi about this? There's a few reasons motivating the change for us, some already mentioned, but worth repeating too...
In most cases we do work around the differences between packaged/unpackaged in the MAUI abstraction layer, however, yes there will definitely be cases that will be incompatible with packaged. As @BretJohnson mentioned, there's nothing stopping developers from switching to use packaged if they like (even if they choose to for a Release build for example), however I do agree, in some cases the difference in behaviours is not that intuitive between packaged and unpackaged. It would be great to have a conversation about how WindowsAppSDK might be able to help improve packaged app scenarios to help with some of these pain points which have led us down this path to begin with :) |
Would love that, and if we can improve the tooling and the dev experience for everyone, that'd be awesome 😄 |
I will add that Miguel Ramos said what's below about unpackaged being the default 2.5 years ago, back when he was the WinUI PM (this is from an email thread on the subject). Though at the time (1.1) unpackaged support wasn't ready yet - there were too many issues. I can forward the thread to MS internals who are interested - just holler.
|
In addition to the hurdles @Redth points out, just want to add here that we made this change intentionally, with a lot of discussion, and most importantly telemetry data to back it up. There is an extremely high rate of deployment failures in our new user retention data funnel. Since Windows is the default deploy target for MAUI, the top error (by far) is the device doesn't have developer mode enabled. Many users cannot enable this because of locked down environments. This change to the new project template for .NET 9 is documented (or it will be, I'll check on the state of the updates to the docs) and we added a property on the project properties page to toggle this easily in VS. This doesn't change existing projects. This also doesn't change the publishing tooling at all (it still only supports packaged) even though an overwhelming number of our users ask for unpackaged app deployments. Our users want the same experience as WPF/WinForms and have been asking for this for years. Currently users can only publish unpackaged apps on the command line (with workarounds) because of WinAppSDK bugs. Also adding @MSLukeWest who is looking into working around these for tooling. |
Description of Change
Right now, the Windows portion of a .NET Maui application is built as a packaged app. This will make it so newly created projects will be unpackaged by default.
The link pointed to in the comment (https://aka.ms/MauiTemplateUnpackaged) is temporary, we'll need to create a new help page for this.