The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

ad error handling RRS feed

  • General discussion

  • Ok I would like to handle error messages in my game for my ad control i have something like this but it isnt the best though

    bannerAd.ErrorOccurred +=


    new EventHandler<Microsoft.Advertising.AdErrorEventArgs>(AdError);




    public void AdError(object sender, Microsoft.Advertising.AdErrorEventArgs args)








    how can i see what error messages are coming through? I would like to know when i lose internet connection.

    Tuesday, March 13, 2012 2:49 AM

All replies

  • args.Error will give you the exception thrown by the Ad Control so args.Error.Message should tell you what the error was.
    Tuesday, March 13, 2012 9:40 AM
  • ok so it returns me a message but how do i compare them. I know the error message is 404 so i then delete the adgame component and the components where the ad is stored but yet my game still crashes.
    Wednesday, March 14, 2012 10:18 PM
  • I didn't realise your game was crashing as you didn't mention that in your original post.  You only asked how you could see what error messages were coming through.

    The Ad components shouldn't cause your game to crash (even if there is no internet connectivity) although there were (and possibly still are) some bugs in older versions.  Do you have the latest version of the Ad SDK (released last week)?

    Is it definitely the Ad that's causing your game to crash?  Have you crashed it with the debugger attached and looked at the exception/stack trace to see what the reason for the crash is?

    I write Silverlight apps, not XNA, so can't really help with the removal of the Ad components.
    Thursday, March 15, 2012 1:54 PM