0

I just downloaded UWP/.NET to run some project I found of github.

private void OnLoaded(object sender, RoutedEventArgs e)
{
    var button = null as Button;
    var b = button.CommandParameter;
    //throw new InvalidOperationException("Testing");
}

Throwing the exception breaks the program as expected. However, the null access crashes the app and the only debug output message I get is

The program '[12036] eReader.exe' has exited with code 2148734499 (0x80131623).

According to hresult.info 0x80131623 is Runtime operation halted by call to System.Environment.FailFast().

However, the original error that was crashing the app from a call to StorageFile.CopyAsync has now gone away, so I can no longer test the debugging configuration.

Tom Huntington
  • 2,260
  • 10
  • 20
  • 1
    I can reproduce the problem in my test. Does [this link](https://stackoverflow.com/questions/38175242/the-program-13492-dotnet-exe-has-exited-with-code-2147450749) can give you some help? – Jingmiao Xu-MSFT Oct 21 '22 at 08:36
  • @JingmiaoXu-MSFT yes, I tried build without having .NET and UWP installed, cancelled the build and installed. But then had problems, which resolved themselves – Tom Huntington Oct 21 '22 at 21:50

1 Answers1

-1

The debugger now breaks on the null access. I've done nothing at all apart from recompiling minor changes and rerunning.

Just try again until it works?

Edit: actually it might have been moving the error from an async method to a synchronous method. Maybe visual studio needs to have an error in a synchronous method before it can handle errors in async methods.

Edit 2: perhaps it's because I tried to build before having .NET and UWP installed. I stopped the after the build was non-responsive and installed, but perhaps there were some complications.

Tom Huntington
  • 2,260
  • 10
  • 20