Join the Conversation!
We're interested in hearing what you have to say. Sign in with your Windows Live ID to leave comments or start new discussions.

ADControl is crashing my WP7 game with no exception to be found

This question has suggested answer(s)
Working on a game with the Mango SDK Beta 2 using mixed silverlight/xna. The game exits (during game play screen i.e. xna) both on emulator and HTC device, intermittently. I keep playing it attached to debugger waiting for it to crash and it just exits without hitting any breakpoint in App.UnhandledException. I tweaked a registry key to enable the Console for the XDE emulator. In the console when the application exit happened during gameplay - it showed me an assertion error: Assertion: Thread ID= xxx Proc-Id= xxx 'TaskHost.exe' , VM-active= xxx agwebbrowsercontrol.dll+0.0004169c SP=030afb70 xyzxyzxyzxyz Terminating process due to assertion failure I was completely clue less as to what web browser control was it talking about. Then i realized I have Microsoft Ad Control on the Silvelright content , that is mixed with XNA game. When the game is paused by the user or a milestone is achieved in game, I pause the game and the AD Control is shown among other things to the user. Anyways, I just went ahead and removed the ad control from the SL XAML. And I didnt get the error for a considerable period of time (usually the app would crash between 2 - 5 minutes of game play) so I exited and then I put the Ad control back on and tried setting IsAutoRefreshEnabled to false , hooked on to the Adrefreshed and ErrorOccured events on the ad control but no luck still crashed without hitting any break point and without giving any exception in the VS debugger. I only see the error in the emulator. I reproduced the error in a sample from MS APP Hub (Silverlight + XNA mixed content sample) All i did was put the SL AdControl in teh XAML.. it keeps showing test ad and then app exits.. the error is only found in the XDE console. I have no idea how to handle this situation. I probably will go ahead and remove all SL content from the GAME page and try to do my game HUD, Ad Control etc in XNA :S but I am not sure if that would solve the issue or not since the issue I assume is internal to the working of the Ad control, so whether i use the SL version or the XNA version, should it matter???
All Replies
  • This mix of Silverlight and XNA is a "hybrid" app. The short answer to the question "should it matter" is yes; this scenario is unsupported. Don't do this is the even shorter answer. The AdControl team has been doing some work to figure out what happens in these scenarios. Your app is not the first to do this and I've been following issues with other products where developers are trying this. Once I catch up on that I hope to write a blog topic about it. In the future it may be supported, but for now it is not.
  • I assume The issue was resolved in the RC release of Mango SDK that included the AD control SDK as well. I am not seeing the crash anymore. However it should be noted that AFTER RC, if you have width/height set to AUTO on the AD control, the ad control throws (web exceptions) exceptions internally. The ad control will only work if you provide a specific width and height. I think this should be fixed in a patch and for teh time being documented in the Advert SDK so developers know about it.
  • SQ
     PR: ?
     I: ?
     L: ?
     Cached: ?
     I: ?
     L: ?
     LD: ?
     I: ?
     Rank: ?
     Age: ?
    IP: ?
     whois
    source
    Robo: ?
    Sitemap: ?
     Rank: ?
     Price: ?
     C: ?
    Info
    Density

    i have the same probleme i want to integrate an ads in the xna of an silverlight/xna project and i don't find how to do this.

     

    Have you an issue ?

  • Yes, I was able to put Ad Control on the Silverlight page - XAML. After the RTM release, it has stopped crashing. I did see the ad control throw exceptions a couple of times, but it dint exit the app. Just follow the documentation to put the Silvelright AD control on the Silverlight page.
  • SQ
     PR: ?
     I: ?
     L: ?
     Cached: ?
     I: ?
     L: ?
     LD: ?
     I: ?
     Rank: ?
     Age: ?
    IP: ?
     whois
    source
    Robo: ?
    Sitemap: ?
     Rank: ?
     Price: ?
     C: ?
    Info
    Density

    after this line ?

     

     <!--No XAML content is required as the page is rendered entirely with the XNA Framework-->

  • Yes sure, they say its not required :) but you can mix SL + XNA. you will have to use UI Element Renderer to draw SL elements on the XNA surface. Just bing SL + XNA mixed mode. You will find great samples on create.msdn.com as well.
  • SQ
     PR: ?
     I: ?
     L: ?
     Cached: ?
     I: ?
     L: ?
     LD: ?
     I: ?
     Rank: ?
     Age: ?
    IP: ?
     whois
    source
    Robo: ?
    Sitemap: ?
     Rank: ?
     Price: ?
     C: ?
    Info
    Density

    ok ill try it

  • SQ
     PR: ?
     I: ?
     L: ?
     Cached: ?
     I: ?
     L: ?
     LD: ?
     I: ?
     Rank: ?
     Age: ?
    IP: ?
     whois
    source
    Robo: ?
    Sitemap: ?
     Rank: ?
     Price: ?
     C: ?
    Info
    Density

    i have this code but i never seen ads

     

    <!--No XAML content is required as the page is rendered entirely with the XNA Framework-->
        <my:AdControl Name="adControl1" Width="480" Height="80" Margin="0,0,0,0"
                              HorizontalAlignment="Left" VerticalAlignment="Bottom"
                              ApplicationId="test_client" AdUnitId="Image480_80"
                              ErrorOccurred="adControl1_ErrorOccurred" AdRefreshed="adControl1_AdRefreshed"/>

     

    could you paste me a sample of code you use please ?

  • You have to use the UIElementRenderer in order to render silverlight content onto XNA. Just putting the XAML in the file is ONE of the TWO things you need to do. This link describes a SL+XNA project and how to go about it http://msdn.microsoft.com/en-us/library/hh202938(v=vs.92).aspx This link provides project sourcecode for teh tutorial http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx (scroll down to Silverlight/XNA Framework Sample ) Hope that helps.
  • Is this scenario supported after Mango RTW release?
  • I am having the same issue. I have posted another question here http://community.microsoftadvertising.com/forums/p/70611/104182.aspx#104182 Pretty much the same behavior.
  • My recommendation is bite the XNA bullet and do your game MENU UI in XNA as well, since i assume tahst the only reason you are mixing SL+XNA... and I did it due to that as well. I have started porting my project and believe me, its not that hard.. check out GameState sample on create.msdn.com its a starting point.. that sample will give you a decent base on which you can build your game menu UI.
  • Hello everyone,

    Currently we do not have an ad control that can be used on Hybrid-pages in a hybrid app. It is possible to get the AdControl to ‘sort-of-work’ but it is strongly discouraged; the scenario is not supported and the behaviour is undefined and will lead to crashes, hangs etc.

    We know the community wants this and we’re looking into supporting this in the future.

     

    Thank you,

    Peter Litwin | Support Analyst II |

    Microsoft Advertiser and Publisher Solutions Group

     

  • What is the status of this issue? I have 5 apps that are SL / XNA w/ Ad's. They all crash after 3-5 minutes of use. Couple points: 1) Please notify the community when something like this is discovered. I just found this page after searching for a couple months. I'm very frustrated. I made lots of business and architectural decisions based on this working. I could have made the App in all XNA or I could have changed from an Ad model to a Paid/Trial model, if I would've known about this before. 2) What is the guidance to deal with this situation? Looks like my soltions are to: a) convert all of my app(s) to all XNA? No other Ad Providers work with XNA. or b) remove Ad's entirely and convert Apps to a Paid/Trail model. 3) Please notify when this is fixed. If there's a list of people who get notified when this is fixed, add me to the list. I want to be notified when this is fixed. I searched for a long time to find out the problem isn't on my end. Thank you, Doug Mair Corpria Thanks, Doug Mair
  •  

    I think this issue should be made much more public. I would never have went the Silverlight/XNA way for my game if I knew about it. 

     

    I share everything Doug said. Can we have an update on this? I have released a new game and the reviews/downloads have been great so far and I am getting about 80 000 impressions daily. However, a lot of people have given very low review scores due to the fact that the game crashes every 2-3 minutes due to this problem.

    What's taking so long to fix this?