microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 676 forks source link

NavigationView causes crash in Reunion-0.5 pre UWP #4499

Closed kalin-todorov closed 3 years ago

kalin-todorov commented 3 years ago

Describe the bug Defining NavigationView on the MainPage throws exception with Reunion-0.5pre

Steps to reproduce the bug

  1. Create a blank WinUI 3 for UWP application with Project Reuninon SDK.
  2. Put NaviagionView on the MainPage.
  3. Run the app

Expected behavior The app to run correctly

Screenshots image

Stack Trace onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 15294327) ReturnHr(1) tid(6e24) 80070490 Element not found. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 15293FE7) ReturnHr(2) tid(6e24) 80070490 Element not found. onecore\internal\sdk\inc\wil\opensource/wil/com.h(1256)\Microsoft.UI.Input.dll!7BA3EDAB: (caller: 7BA3F8FD) ReturnHr(1) tid(6e24) 80004002 No such interface supported onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 15293FE7) ReturnHr(3) tid(6e24) 80070490 Element not found. 'App14.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.ProjectReunion.0.5-Prerelease_0.52103.9000.0_x86__8wekyb3d8bbwe\Microsoft.DirectManipulation.dll'. 'App14.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.Energy.dll'. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 15294327) ReturnHr(4) tid(6e24) 80070490 Element not found. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 152941D6) ReturnHr(5) tid(6e24) 80070490 Element not found. onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!152944D2: (caller: 15294327) ReturnHr(6) tid(6e24) 80070490 Element not found. onecoreuap\base\mrt\runtime\src\cresourcemanagerinternal.cpp(682)\mrmcorer.dll!14485348: (caller: 1448D98A) ReturnHr(1) tid(6e24) 80073B1F ResourceMap Not Found. onecoreuap\base\mrt\runtime\src\cresourcemanagerinternal.cpp(575)\mrmcorer.dll!1448DA5B: (caller: 14484957) ReturnHr(2) tid(6e24) 80073B1F ResourceMap Not Found. onecoreuap\base\mrt\runtime\src\cresourcemanagerinternal.cpp(1672)\mrmcorer.dll!1448497D: (caller: 14484E65) LogHr(1) tid(6e24) 80073B1F ResourceMap Not Found. App14.exe has triggered a breakpoint.

Exception thrown at 0x764C46D2 (KernelBase.dll) in App14.exe: 0x00000004: The system cannot open the file (parameters: 0x80073B1F, 0x00000003). Unhandled exception at 0x764C46D2 (KernelBase.dll) in App14.exe: 0x00000004: The system cannot open the file (parameters: 0x80073B1F, 0x00000003).

onecoreuap\base\mrt\runtime\com\winrt\core\lib\winrtresourcemap.cpp(444)\mrmcorer.dll!144DA8BB: (caller: 14087AA9) ReturnHr(3) tid(6e24) 80073B1F ResourceMap Not Found. Exception thrown at 0x764C46D2 (KernelBase.dll) in App14.exe: WinRT originate error - 0x80073B1F : 'ResourceMap Not Found.'.

NuGet package version: WinUI 3 - Project Reunion 0.5 Preview: 0.5.0-prerelease

Windows app type: UWP Win32
Yes
Windows 10 version Saw the problem?
May 2019 Update (18362) Yes
Device form factor Saw the problem?
Desktop Yes
huoyaoyuan commented 3 years ago

Duplicate of https://github.com/microsoft/microsoft-ui-xaml/issues/4496

kalin-todorov commented 3 years ago

Duplicate of #4496

Saw the other one, however the root cause of this issue seems different to me. This one is in UWP and it doesn't seem to be related to brushes.

StephenLPeters commented 3 years ago

@ojhad FYI. If this is a different issue from 4496 and this is unique to UWP we should tag it with Winui3-UWP tag as well.

StephenLPeters commented 3 years ago

@kalintodorov does the work around huoyaoyuan suggests in #4496 work for your UWP application?

Noemata commented 3 years ago

Disable C++ exceptions as shown here: https://github.com/microsoft/microsoft-ui-xaml/issues/4510

kalin-todorov commented 3 years ago

@kalintodorov does the work around huoyaoyuan suggests in #4496 work for your UWP application?

No - it doesn't work.

kalin-todorov commented 3 years ago

Disable C++ exceptions as shown here: #4510

Already did that - continues to crash :)

Noemata commented 3 years ago

@kalin-todorov , I'm using NavigationView here: https://github.com/Noemata/FakePOS/blob/master/FakePOS/FakePOSuwp/Views/ShellView.xaml

After disabling c++ exceptions, it's working in this app. So there may be more in the mix than just the NavigationView in your case. That said, this is not UWP, a detail I didn't notice when I first looked at your issue. I found WinUI 3.x on UWP less stable thus far and am staying away from it given WinUI 2.x for UWP is solid. I've opted for parallel code instead as was done in the repo above. 99% of the code is common, except for the conditional compiler noise in the sources.

kalin-todorov commented 3 years ago

@Noemata attaching sample project here: App15.zip

Noemata commented 3 years ago

@kalin-todorov , sorry to report this, but your sample is working for me:

image

I didn't have to take any special actions. Just build and run (selected the x64 build for the above).

The only suggestion I can think of is to update your system's OS to the latest bits. I'm at 19042.867. I'm not running with the Preview version of VS. VS is at 16.9.1, with a small set of extensions installed. I'm using a parallel UWP build to author the UI side of things for WinUI desktop.

kalin-todorov commented 3 years ago

Hm interesting - my Win 10 is 18362.1256 and running the project with the latest preview 16.10 preview 1.

Noemata commented 3 years ago

@kalin-todorov , obviously VS is unlikely to be the issue, I just wanted to give you the full picture of what my side looks like. The OS could be, or something else on your system that has gummed things up. I have run into other problems with WinUI over UWP, but not what you're seeing. I'm going to wait for the next release before I seriously start looking at WinUI over UWP. It doesn't bring anything new to the table yet other than making it easy to author across UWP and desktop. I'm hoping perf isn't degraded for the UWP side of things as that will void the prospect of considering WinUI over UWP for most of my customers (high perf TV Broadcasting apps). Fingers crossed Microsoft keeps the UWP side of things as is or improves things even more.

kalin-todorov commented 3 years ago

FYI: upgraded the OS to 19041 and the project started to work.

Noemata commented 3 years ago

@kalin-todorov , cool that you got it resolved!

anawishnoff commented 3 years ago

Hi @kalin-todorov, you should see a fix for this bug in the upcoming WinUI 3/Project Reunion 0.8 Preview, which you can expect soon. Thanks for filing this!