maui
maui copied to clipboard
What's going on with the splash-screen?
Description
I am converting from XamarinForms to MAUI, for platforms Android and Windows. I am trying to get the splash screen working again on Windows.
Depending of my setup, I get several problems, none of them leading to a desired result.
What's going on? How to get this working?
Steps to Reproduce
In the central project-file there is a property like below. I found this described as being the only splash-screen needed. But this only works for Android.
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#58ACFA" BaseSize="350,350" />
Then I tried to recreate the setupfor Windows as on XamarinForms.
- Start from scratch in Package.appxmanifest.
- In Visual Assets generate from a png file to Platforms\Windows\Assets and name it 'SplashScreen'. The files get generated, but there are no previews to be seen.
- When starting I get: "error 0x80070003: Cannot install or update package ... because the splash screen image [SplashScreen.png] cannot be located"
- Analogous to XamarinForms I set the build actions to 'Content'. (Why isn't this generated?) Now I get previews. but as later turns out I also get "Warning XA0101 @(Content) build action is not supported".
- Setting build actions to 'Embedded Resource" takes the latter away, but does not solve the main problem.
- After a clean, rebuild and even needed restart of VS, the application runs, but without a splash-screen.
- Analogous to XamarinForms I set the entry point to 'RCS.PortableShop.WinUI.App' instead of '$targetentrypoint$'. (How useful are those placeholders anyway?) Now I get the splash-screen, but the application crashes with "application called an interface that was marshalled for a different thread"
So, not getting anywhere yet.
All these attempts seem futile, as I would assume that MauiSplashScreen should suffice.
By the way, even VS crashes sometimes when working on the Visual Assets.
Link to public reproduction project repository
Current commit: https://github.com/a-einstein/PortableShop/commit/e32e23f00fd0cb25fa68e9c4d521941a0887b344
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
windows 10.0.17763.0
Did you find any workaround?
No.
Relevant log output
No response
Depends on
- [ ] https://github.com/microsoft/microsoft-ui-xaml/issues/4055