Warning: count(): Parameter must be an array or an object that implements Countable in /customers/a/f/c/fjorden.se/httpd.www/joel/scripts/sb_display.php on line 480 Blog by Joel Fjordén a.k.a. Will o Wisp
SavePictureToCameraRoll throws InvalidOperationException in Windows Phone 7.1 (Mango) 
Wednesday, July 13, 2011, 06:09 AM - Windows Phone 7
I recently upgraded my Windows Phone 7.0 project to 7.1 (Mango), by simply changing the Target Windows Phone Version setting in project properties.

After that I wanted to utilize the SavePictureToCameraRoll feature, but this call always throw an InvalidOperationException simply stating, "An unexpected error has occured.".

Trying the same thing in a new project worked like a charm, so after some digging and file comparisons I found that the WMAppManifest.xml file is not "upgraded" when changing the target version to 7.1, and in order to be able to call this method the ID_CAP_ISV_CAMERA capability must be added.

I hope this can save someone else's time!
2 comments ( 152 views )   |  related link