-
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
COMException -2147023728 when calling BackgroundTaskRegistration in MAUI WinUI project #27590
Comments
Added link to repository |
Is this a packaged or unpackaged app? Seems to be this: microsoft/WindowsAppSDK#4201 Even this: microsoft/CsWinRT#1518 |
@RoiChen001 are you able to use .net 8 and upgrade the Windows App SDK to the latest? |
Does this happen on Windows 11 AND Windows 10? |
Looks like a problem with the In the new .NET 8 project, deselecting the "Create a Windows MSIX package." option adds the |
Thanks for the issue report @Mvk3aJKQh! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS. If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
|
Well I can't find information about whether (MSIX) packaging is required to use WinRT. The exception suggests that it is required, since a value of "None" causes the exception in both projects. This would seem to be an issue with an API, and not Visual Studio. The properties UI in Visual Studio does something different between newly created .NET 8 and .NET 9 projects, but the issue is the same when deselecting the "Create a Windows MSIX package." option in the .NET 8 project. So we still have a requirement to create an MSIX package to access the |
Description
I created both a brand new single and multi-app MAUI project, and added
System.Diagnostics.Debug.WriteLine(Windows.ApplicationModel.Background.BackgroundTaskRegistration.AllTasks.Count);
to the WinUI App constructor afterInitializeComponent();
and it throws this exception. Works for .NET 8, but not for .NET 9. Creating the new project for .NET 8, then selecting .NET 9 for Windows prompts to install the Android SDKs when building.Steps to Reproduce
System.Diagnostics.Debug.WriteLine(Windows.ApplicationModel.Background.BackgroundTaskRegistration.AllTasks.Count);
to the WinUI App constructor afterInitializeComponent();
Link to public reproduction project repository
https://github.com/Mvk3aJKQh/COMException-2147023728
Version with bug
9.0.14 SR1.4
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
.NET 8
Affected platforms
Windows
Affected platform versions
Windows 10 build 19045.5371
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: