Faulting module name: Windows.UI.Xaml.dll in UWP app

℡╲_俬逩灬. 提交于 2019-12-25 01:50:00

问题


In my UWP app, on click of AppBarButton application crashes

Click Event:

private void recordBtn_Click(object sender, RoutedEventArgs e)
        {
            BtnAcquire.Visibility = Visibility.Collapsed;
            BtnIncrement.Visibility = Visibility.Visible;
            BtnPause.Visibility = Visibility.Visible;

            BtnPrevious.IsEnabled = false;
            BtnNext.IsEnabled = false;
            _startRecording = true;
            _threshold = Convert.ToDouble(TxtThreshold.Text);
            _rootPage.NotifyUser(
                _startAcquisition
                    ? "Record in progress"
                    : "Record is paused",
                _startRecording ? NotifyType.StatusMessage : NotifyType.ErrorMessage);

        } 

This code is crashing the app in release mode, if I run it in debug mode from Visual Studio it works fine.

If I comment the code in Click event, then app wont crash.

Error 1 in Event Viewer:

Faulting application name: MyApp.exe, version: 1.0.0.0, time stamp: 0x5a6840de
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.17763.168, time stamp: 0xbb211a61
Exception code: 0xc000027b
Fault offset: 0x008dcb61
Faulting process id: 0x39f4
Faulting application start time: 0x01d4b1b7bb42e78c
Faulting application path: C:\Projects\..\bin\x86\Debug\AppX\MyApp.exe
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: 18aa82bd-8807-43bc-9ddc-dc7ce186f52e
Faulting package full name: MyApp_1.0.10.0_x86__1cxs26n94vksc
Faulting package-relative application ID: App

Error 2 in Event Viewer:

Faulting application name: MyApp.exe, version: 1.0.0.0, time stamp: 0x5a6840de
Faulting module name: combase.dll, version: 10.0.17763.253, time stamp: 0xa3f81b2d
Exception code: 0xc000027b
Fault offset: 0x00209931
Faulting process id: 0x18bc
Faulting application start time: 0x01d4b1b8ec03b132
Faulting application path: C:\Projects\...\bin\x86\Debug\AppX\MyApp.exe
Faulting module path: C:\WINDOWS\System32\combase.dll
Report Id: 7ac0d37c-4d5f-4d02-96ec-2bfa2d4f4668
Faulting package full name: MyApp_1.0.10.0_x86__1cxs26n94vksc
Faulting package-relative application ID: App

Also when I change configuration manager from Debug to Release and do build i get the following error

Severity    Code    Description Project File    Line    Suppression State
Error       ILT0005: 'C:\Users\userName\.nuget\packages\runtime.win10-x64.microsoft.net.native.compiler\2.1.8\tools\x64\ilc\ilc.exe --gatekeeper @"C:\Projects\Smart\UWP\obj\x64\Release\ilc\intermediate\gkargs.rsp"' returned exit code 1 MyApp           

Here is a minimal code that can show the error Code Download

Reproducing steps

  • Build, Deploy and Run in debug mode
  • App will prompt you to choose a microphone on PC
  • Please select one and click Next button
  • After you land on next page, click on Acquire button
  • This will work fine.
  • Stop debugging.
  • Now go to Windows Start and search for HaBo Recording
  • Launch the app
  • Repeat the same steps
  • After you click on Acquire button, you will notice app will get froze in couple of seconds and then crashed.

回答1:


Problem was with xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" So I replaced DataGrid Control with Telerik UWP Grid Control as explained over here that solved my issue.




回答2:


I just messed around with this kind of crash/error on production/deployed app with event error "Faulting module name: Windows.UI.Xaml.dll in UWP application".

As a solution for my case I had to use default "ContentDialog" Style rather then my custom made style! So if you have used any custom style for any control on that page/window that you want to open, try using without it!

Hope this could solve your problem!

Thank you.



来源:https://stackoverflow.com/questions/54296269/faulting-module-name-windows-ui-xaml-dll-in-uwp-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!