Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Access Violation Crash on Windows Phone Devices

0.00/5 (No votes)
21 Apr 2015 1  
Access Violation Crash on Windows Phone Devices

Introduction

I’m currently working on a Windows Phone 8.1 app and I noticed that the app crashes when I test it on my Lumia 930. The weird thing was that I was getting no exception, the debug session was stopped when I was navigating in the app. I tried to catch unhandled exception but this also failed. I started looking in the debug output, and I noticed the following line:

The program '[3452] MyApp.WindowsPhone.exe' has exited with code -1073741819 
(0xc0000005) 'Access violation'.

I Googled around a bit and noticed that other people were having the same issue but in other scenarios. For example, some of them had image manipulation as the cause, others had WebViews (myself included, but this wasn’t the issue in my case), or custom controls. I’ll make your Google search easier by enumerating here some of the fixes that I found.

1. Run Visual Studio as Administrator

Some people had this issue while building the project, or even when the app was running. It seems that Visual Studio didn’t have enough rights to access some parts of the memory while debugging. For some people, it worked running it as administrator, but not for me.

2. Remove WebView

Not something you may want to hear about especially if you really need it, but there was/is a bug with the WebView control that was supposed to be fixed in WP 8.1 Update 1. If you need to display a website, you could use the Launcher or you could hope that only a few users will get this crash.

3. Use Dispatcher for Navigation

This helped me fix it. Apparently, due to another bug in WP 8.1, you have to use the Dispatcher when you navigate and you have this crash.

Here are some of the interesting posts I found during my search:

I spent almost one hour searching for some answers, so I hope any of these fixes helped you! Happy coding! :)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here