Making the MS Adcontrol REALLY work on phone 7
Join the DZone community and get the full member experience.Join For Free
You went out to this site:
and created an 'ad unit' and gotten an application id for your app.
you then have downloaded the phone 7 ad SDK from this link
included and referenced the ad DLL and created the xaml that looks to the effect of :
(at the top of your xaml)
(some where on the page)
<advert:AdControl x:Name="AdvertControl" ApplicationId="[Guid here]" AdUnitId="[ad unit id here]" AdModel="Contextual" RotationEnabled="True" Width="480" Height="80" Margin="0,-1,0,0" UseLayoutRounding="False" VerticalAlignment="Top" d:LayoutRounding="Auto" d:LayoutOverrides="Height" > </advert:AdControl>
you've compiled and uploaded and even went so far as to test your app using the test values they provide for the application id and ad unit id... your app is approved but your not getting any hits...
hmm... what you have over looked... oops they left out one tiny detail... at least in all the directions I have found... in your constructor or in our override onnavigateto try adding this little bit of C#...
AdControl.TestMode = false;
really? as much as it makes me tired all over... yes this is all the magic I needed todo...
Published at DZone with permission of David Kelley. See the original article here.
Opinions expressed by DZone contributors are their own.