Image Editor Application_UnhandledException

Thread is closed for posting
3 posts, 0 answers
  1. Joaquim
    Joaquim avatar
    7 posts
    Member since:
    Sep 2011

    Posted 14 Jun 2014 Link to this post


    I am trying to build a Image Editor for Windows Phone 8 app but every time  I save an image I always get a system Application_UnhandledException like bellow;

    + $exception {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
       at Microsoft.Xna.Framework.Media.MediaLibrary.SavePicture(String name, Stream source)
       at Telerik.Windows.Controls.RadImageEditor.SaveJpg(WriteableBitmap image, String fileName, Int32 quality)
       at Telerik.Windows.Controls.RadImageEditor.SaveToPhoneLibrary(String fileName, Int32 quality)
       at Telerik.Windows.Controls.RadImageEditor.<OnApplyClick>d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
       --- End of inner exception stack trace --- 

    Please find my project here...

    I'll be very grateful if someone could help me.
    Thanks in advance

  2. Ves
    Ves avatar
    2926 posts

    Posted 18 Jun 2014 Link to this post

    Hi Joaquim,

    Windows Phone 8 apps need to specify the ID_CAP_MEDIALIB_PHOTO capability to access photos in the media library. After adding it to the WMAppManifest.xml it started working as expected.

    As a side note, I have edited your post to remove the link to the project, as it contains dev assemblies, which are not publicly available. In case you need to attach a project, you can open a formal support ticket. This way you will be able to add private attachments.

    Best regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Joaquim
    Joaquim avatar
    7 posts
    Member since:
    Sep 2011

    Posted 18 Jun 2014 in reply to Ves Link to this post

    Thank you for the tip. Its working fine now.

    Best Regards
Back to Top