Describe the bug
AppWindow.Presenter is not recognized as or casted to OverlappedPresenter when changing the framework from Net 8 to Net 9 with PublishAot=true
Steps to reproduce the bug
- Create new WindowsAppSdk project
- Write something like
myButton.Content = AppWindow.Presenter is OverlappedPresenter ? "Yes" : "No"; in MainWindow.xaml.cs
- Publish with net8.0-windows10.0.19041.0 (default) and PublishAot=true - “Yes” is displayed on the button
- Change TargetFramework to net9.0-windows10.0.19041.0 and publish aot - "No" is on the button
Expected behavior
The result should be the same
Screenshots
No response
NuGet package version
Windows App SDK 1.6.3: 1.6.250108002
Packaging type
Unpackaged
Windows version
Windows 11 version 24H2 (22621, October 2024 Update), Insider Build (xxxxx)
IDE
Visual Studio 2022
Additional context
If you add AppWindow.Presenter.As<OverlappedPresenter>(); somewhere even without using the result, it fixes the type check and cast