1

i get "An unexpected error has occurred." when using MediaLibrary.GetPictureFromToken(String token). Has any one the same Problem?

Device: HTC Mozart

1
  • 1
    What are the details of the error?
    – Matt Lacey
    Jan 14, 2011 at 10:03

3 Answers 3

3

I was getting this as well, and after some digging, it's because I didn't have the ID_CAP_MEDIALIB turned on in the App Caps.

<Capabilities>
  <Capability Name="ID_CAP_LOCATION"/>
  <Capability Name="ID_CAP_NETWORKING"/>
  <Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
  <Capability Name="ID_CAP_GAMERSERVICES"/>
  <Capability Name="ID_CAP_MEDIALIB"/>
</Capabilities>
2

Welcome to the wonderful and exciting world of "Media" programming on WP7.

You cannot access the WP7 Media library while debugging a WP7 device that is connected to Zune. The exception you described is the exception you'd normally see in this situation. You have 2 options:

  1. Close Zune, and start WPConnect instead. That should allow you to debug from Visual Studio without Zune. And it even supported Media apps. the file is located on my machine @ C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect\WPConnect.exe

  2. Consider using the unlocked emulator ROM for debugging the Pictures hub in the emulator.

0

Could it be that your phone has run out of storage space if you've been generating a lot of data/pics/etc?

You can check this in Settings | About.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.