title: Faulting module name: Windows.UI.Xaml.dll in UWP app
body: <p>In my UWP app, on click of <strong>AppBarButton</strong> application crashes</p>
  
  <p>Click Event:</p>
  
  <pre><code>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);
  
          } 
  </code></pre>
  
  <p>This code is crashing the app in release mode, if I run it in debug mode from Visual Studio it works fine.</p>
  
  <p>If I comment the code in Click event, then app wont crash.</p>
  
  <p><strong>Error 1 in Event Viewer:</strong></p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>Error 2 in Event Viewer:</strong></p>
  
  <pre><code>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
  </code></pre>
  
  <p>Also when I change configuration manager from <code>Debug</code> to <code>Release</code> and do build i get the following error</p>
  
  <pre><code>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           
  </code></pre>
  
  <p>Here is a minimal code that can show the error  <a href="https://fil.email/pQehX0Ld?&amp;showconfirmation=true" rel="nofollow noreferrer"><strong>Code Download</strong></a></p>
  
  <p><strong>Reproducing steps</strong></p>
  
  <ul>
  <li>Build, Deploy and Run in debug mode </li>
  <li>App will prompt you to <strong>choose a microphone</strong> on PC</li>
  <li>Please select one and click <strong>Next</strong> button</li>
  <li>After you land on next page, click on <strong>Acquire</strong> button</li>
  <li>This will work fine. </li>
  <li>Stop debugging. </li>
  <li>Now go to <strong>Windows Start</strong> and search for <strong>HaBo Recording</strong> </li>
  <li>Launch the app </li>
  <li>Repeat the same steps </li>
  <li>After you click on <strong>Acquire</strong> button, you will notice app will get froze in couple of seconds and then crashed.</li>
  </ul>