WP7 Ad Control and OutOfMemoryException
Sunday, August 28, 2011 at 12:43AM Recently we added the Windows Phone Ad Control to one of our existing applications. It ran fine on the emulator but as soon as you put it on a real device it crashed with a System.OutOfMemoryException. Turns out after a little investigation and locating this forum post the issue is related to capabilities specified on the application.
More specifically you need to have ID_CAP_WEBBROWSERCOMPONENT in your WMAppManifest.xml list of capabilities. Here’s the exact line you need to add:
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
That’s not the only capability that is needed when you add advertising, just happened that we already had the other ones on the list. Walt Ritscher has a good blog post here that talks about how 3rd party DLLs and other references you add can expand your security foot print.
The Marketplace Test Kit or the Windows Phone Capability Detection tool can detect and auto generate these capabilities for you – details here,
Reader Comments