I’m updating my existing applications to Silverlight 2 RC and bumped once again into the not so self-explanatory “AG_E_NETWORK_ERROR“. Due to developer’s-momentary-amnesia caused by ultra-multi-tasking , I just couldn’t find a reason for the error and spent unnecessary time to solve something I had already done once or twice. So I decided to note down an online tip to check out for future Silverlight experiments before diving into detailed forum searches.
If your Silverlight application is using media files from your local application directory, you need to copy it to the ClientBin directory. In case you forget to do so, you will see an Error Dialog in your browser once you run the application with this joyful message:
Error: Unhandled Error in Silverlight 2 Application SilverlightApp.xap
This was the error in my application and taking a closer look at the ClientBin solved my problem. In fact, your error could be caused by something else. If you need some time to find more about your error, but you don’t want your application to shoot out this error dialog, add the MediaFailed event to your MediaElement objects and handle errors as appropriate. This is a clue I got from Mike Snow’s “Silverlight Tips of the Day” blog; which has always lots of up-to-date info!
Here’s some lyrical closing statement to end my entry plus today:
May your night
What if it’s not amnesia; but a split personality issue?!? LOL. Upon further investigating this issue – actually it’s quite obvious that the poet didn’t/couldn’t/won’t remember the developer’s error correction. Ok – no need to panic then; calm down; everything is resolved! Is it?!? 🙂