0

I have a UWP application with a desktop extension. The application is now crashing intermittently with the following message in Visual Studios output:

The program '[28160] Desktop_Extension.exe' has exited with code 0 (0x0).

The program '[2032] My_UWP_Application.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

It seems the problem is not the Desktop extension but rather with the UWP application.

Is there a way I can handle the exception so that I can debug the source of the issue? From research I've found "HandleProcessCorruptedStateExceptions" as a possible method of doing so but am unsure how to implement this in a UWP application.

I've tried the following with my method for Unhandled Exceptions:

    [SecurityCritical]
    [HandleProcessCorruptedStateExceptions]
    private void OnAppUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
    {

        Debug.WriteLine(e.Message);
    }

But this method is not being fired when the application crashes.

One thing that could be related is that when there is another error in my code (such as a typo) the following error will be generated:

The "CompileXaml" task returned false but did not log an error.

If I resolve the other error, this error also disappears and the application builds.

Grateful for any help you can provide.

  • This question is identical with ["How to handle AccessViolationException"](https://stackoverflow.com/questions/3469368/how-to-handle-accessviolationexception). – Karen Nersesian Apr 18 '21 at 21:13
  • Unless I am mistaken, I don't believe it is. The main answer has you adding "" to the applications config file. UWP applications don't have a config file so I'm trying to find out how you might enable a similar capability within the slightly different UWP eco-system. At this point, I've resolved my own issue via trial and error but would like to know for future reference. – HooptyDoopty Apr 19 '21 at 16:42

0 Answers0