Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP Access Violation Exception

Tags:

I get the following exception when i move items from a tab to another in an ObservableCollection that is bound to a pivot control in UWP.

Exception thrown at 0x699C7165 (Windows.UI.Xaml.Phone.dll) in IRIS.ZustellerApp.exe: 0xC0000005: Access violation reading location 0x00000000.

I also managed to dig the dump and it seems the exception occurs at Windows_UI_Xaml_Phone!XamlControlsTestHookCreateLoopingSelector

It's interesting this doesn't respect the same pattern every time to reproduce. I almost tried everything to fix this with no result. Thanks in advance.

like image 562
Gabriel Burciu Avatar asked Aug 25 '16 06:08

Gabriel Burciu


1 Answers

I know this is an old topic however I have recently dealt with a similar Access Violation problem and it was caused by attempting to remove a PivotItem with a call from a ContentDialog. Said dialog asked if the user wished to close the pivot and then the access violation occurred. My guess is the ContentDialog runs on a different thread from the UIThread and therefore did not have the proper access to remove a UI component. Perhaps your code is not running on the UIThread too?

My 2 cents.

like image 72
user328414 Avatar answered Oct 26 '22 23:10

user328414