Microsoft provides an ad control to integrate in Windows Phone applications.
The first version of the SDK, namely 2.1.9130.1 released on Sept.29 2010, has a critical bug that crashes your whole application when the ads are set to auto rotation.
You know you’re affected if your application unexpectedly crashes with an “Element is already the child of another element.” error message:
System.InvalidOperationException was unhandled Message=Element is already the child of another element. StackTrace: at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value) at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value) at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value) at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value) at System.Windows.PresentationFrameworkCollection`1.Add(UIElement value) at Microsoft.Advertising.Mobile.UI.AdFrameManager.CreateNewFrame(FrameworkElement controls) at Microsoft.Advertising.Mobile.UI.AdFrameManager.DisplayNextFrame(Boolean newAd) at Microsoft.Advertising.Mobile.UI.AdFrameManager.ResumeFrameRotation() at Microsoft.Advertising.Mobile.UI.AdControl.ActivateAdControl() at Microsoft.Advertising.Mobile.UI.AdControl.OnParentSelectionChanged(Object sender, SelectionChangedEventArgs e)
The workaround so far was to disable auto rotation:
xmlns:ad="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" <ad:AdControl AdModel="Contextual" AdUnitId="123" ApplicationId="123456" RotationEnabled="False" />
On December 8th 2010, Microsoft released an update to the SDK, version 2.1.11120.1
This update seems to have fixed the problem and can be downloaded here.
If you’re running ads in your apps on WP7, please do upgrade to the latest version as you may not even be aware of this bug.
Microsoft showed a lack of communication about this update:
1/ The blog post announcing the update doesn’t describe what the update consists of, and which bugs it fixes
2/ The download page does not have any changelog of overview describing what bug fixes and features are included in the update
In contrast, the Windows Phone Developer Tools January 2011 Update download page does have an Overview section summarizing the important changes.
3/ No email or communication was sent to the PubCenter users.
As a PubCenter member I receive updates on how great PubCenter is, that it represents 33.8% of U.S search queries with the partnership with Yahoo! and other communications explaining how to use PubCenter.
4/ No message in the “What’s New” section of the PubCenter advertises the update.
The last message I have from this section dates back to September.
How come, with at least 4 different communication channels listed above, I’m not alerted when something really important happens, like an update to a buggy SDK?
Did I completely miss it?
Or was it an intentional silent update to avoid admitting an embarrassing bug?
A search on “Element is already the child of another element” in the PubCenter forums yields nothing.
The same search on the Windows Phone 7 developer forums returns 2 main threads:
Another thread started on November 16th with user as far as Jan. 23rd posting they encounter the problem before a Microsoft employee (Mark Chamberlain) suggests using the latest Advertising SDK:
Are you folks using the latest Advertising SDK?
I found an internal email thread suggesting that it is the cure for the issue (Element is already the child of another element)
Hope this helps,
Obviously I was not the only one not knowing about the update.
To the Microsoft Advertising SDK team, could you please be more communicative about your updates and bug fixes?
Developers would greatly appreciate.
MSFT responded favorably to our request for more communication.
Thanks guys for being proactive and listening to your developer community.
MSFT is doing a great job following and supporting their dev community for Windows Phone 7, we’re impressed.
Well we’re not impressed anymore: on 02/11 Douglas Robb from Microsoft acknowledged the problem this way:
Thanks for the suggestion. We hear you. Those above me also hear you. When I say ‘those above me’ that means pretty much everybody, so have no fear, the word is out.
And we falsely assumed the next release would be… advertised (pun intended).
It was not: a new version was released on 03/04.
Thanks again to Mark Chamberlain to let the WP7 devs know about it.
We urged them again to correct this situation and hopefully next time have the new release properly advertised.
In the meantime, the only way to tell a new release is out is too… refresh the download page everyday.
Oh so lame in 2011 when they could have used one of those (modern?) communication channels:
- a special email sent just for the release
- the “weekly blog recap” email blast
- “Messages” section of the dashboard
- the pubCenter blog
Even more confusing: Only the XNA version of the SDK was updated, not the Silverlight:
Before installing the latest version (and using the Dec. 08 2010 version):
Microsoft.Advertising.Mobile.UI.dll is at version 2.1.11120.1, filesize 89,912 bytes
Microsoft.Advertising.Mobile.Xna.dll is at version 126.96.36.199, filesize 214,400 bytes
Microsoft.Advertising.Mobile.UI.dll is at version 2.1.11120.1, filesize 89,912 bytes (NO CHANGE)
Microsoft.Advertising.Mobile.Xna.dll is at version 188.8.131.52, filesize 216,472 bytes
It can be extremely confusing because the download page is now using the version of the XNA DLL and shows 184.108.40.206 as the version number, which is correct for the XNA library only.
Previously this same download page was using the version of the Silverlight DLL (2.1.11120.1) to show the version.
Dear PubCenter, obviously you cannot switch between using the Silverlight version of the DLL and the XNA version.
Either provide 2 different downloads links with their respective version tied to the DLL version and separate the DLLs, or come up with a compounded version number.
Next time you update the Silverlight SDK, your download link will have a version starting in 2.X, don’t you think that will confuse everyone using the latest 220.127.116.11?
Microsoft now advertising updates and the changelog.
These are for the Silverlight update of December 8th 2010 and the XNA update of March 4th 2011 (about time to get the changelogs…).
Hopefully next release will be advertised the proper way through different communication channels (blog, emails, newsletter, twitter) along with a much needed changelog.
Troy Wood, Portfolio Manager for Windows Phone 7 App Publishers writes:
“Starting with 5.2, both, Silverlight and XNA will use same 5.2.xxxx.y version number.”
Seems the revision problem is fixed for next release.