-
Notifications
You must be signed in to change notification settings - Fork 107
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
Bug: Cannot cast some of the UWP activation arguments using dotnet as operator #1860
Comments
Does |
No, I get an InvalidCastException in this case. |
Can you try to check if the type of |
Using |
I've found the issue with the I haven't managed to see why |
Given this is a class type with just an WinRT exclusive interface, there isn't any |
Description
This is related to microsoft/microsoft-ui-xaml#9983 (comment)
When publishing a UWP project using the preview .net 9 support with AOT, I noticed a crash when an appservice from a win32 helper tries to connect. It turns out that casting the argument (
args.TaskInstance.TriggerDetails
) in theBackgroundActivated(BackgroundActivatedEventArgs args)
activation method toAppServiceTriggerDetails
fails using the dotnetas
operator. However, it works usingargs.TaskInstance.TriggerDetails.As<AppServiceTriggerDetails>()
.Steps To Reproduce
A project that uses background activation through an appservice with a win32 helper is needed. The project also has to be published with AOT in release mode by creating an msix package (it sometimes worked in Debug configuration).
Expected Behavior
Casting using dotnet operator should work
Version Info
cswinrt 2.1.16
dotnet 9 rc2
Additional Context
No response
The text was updated successfully, but these errors were encountered: