DebugSettings.EnableFrameRateCounter = true in Desktop causes an AccessViolation
See original GitHub issueDescribe the bug Create a new WinUI Desktop application and set the DebugSettings.EnableFrameRateCounter = true in the application constructor or the OnLaunched and an access violation exception will occur when the application is run.
Exception thrown at 0x7A0D38FC (Microsoft.UI.Xaml.dll) in WinUI_InDesktop.exe: 0xC0000005: Access violation reading location 0x00000000.
Steps to reproduce the bug
- In the attached solution, run the WinUiDesktop (Package) application. Note that you will be able to safely step over enabling the frame rate counter but the application will crash shortly after.
- For comparision, using the same solution, run the BlankAppUWP (Package). Note that the application will not crash and it will show the framerate counter as expected.
Expected behavior If by chance the DebugSettings.EnableFrameRateCounter setting cannot be used with Desktop applications, then a non-fatal exception message should be thrown. If this feature is supported in Desktop applications then it has a bug.
Screenshots
Version Info .Net5.0 Preview 6
NuGet package version:
<PackageReference Include="Microsoft.WinUI" Version="3.0.0-preview1.200515.3" />
Note that I have been making WinUI work with Preview 6 by adding this additional direct package reference, a trick I learned from Scott Jones. Although I have been able to accomplish quite a bit of Window related work without any crashes, it was worth mentioning.
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="0.1.0-prerelease.200623.5" />
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2020 Update (19041) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Additional context I have attached a solution for easy reproduction of the problem. WinUIDesktop.zip
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top GitHub Comments
This is still happening as of today.
Fixed in WinAppSDK 1.4-experimental1 on 05/23/23; @bpulliam can you please close this bug?