How do you debug a UWP Application Access Violation Error?

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.

c#
xaml
uwp
access-violation
asked on Stack Overflow Apr 18, 2021 by HooptyDoopty • edited Apr 18, 2021 by HooptyDoopty

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0