Note: due to an incompatibility of Nuget with the new way XAML controls are distributed for Windows 8.1 we recommend you use Visual Studio extension to get the SDK. We will make the Nuget version available at a later date once the issue is resolved.
AdDuplex SDK for Windows 8.1 XAML based apps (both C#/VB.NET and C++) is distributed via the Visual Studio extension gallery.
To add AdDuplex AdControl for Windows 8.1 to your XAML (C#/VB.NET/C++) project do the following:
- Install the SDK via the Visual Studio extension by searching for AdDuplex in the Visual Studio Gallery directly from within Visual Studio (Tools > Extensions and Updates > Online > Visual Studio Gallery), select "AdDuplex SDK for Windows 8.1 (XAML)". Or just get it from the Gallery web page.
- From the Solution Explorer window, right click References…, and select Add New Reference…
- Click Windows, and then Extensions. Select AdDuplex SDK for Windows 8 (Xaml). Then click OK.
- Open the MainPage.xaml file (or otherxaml file as appropriate for your project).
- Modify the page to include AdDuplex.Controls namespace:
xmlns:adduplex="using:AdDuplex.Controls"
- Add AdControl to your page:
<adduplex:AdControl x:Name="adDuplexAd" AdUnitId="YOUR_AdUnitId_HERE"
AppKey="YOUR_AppKey_HERE" Size="500x130" /> - Current version of AdDuplex for Windows 8 supports these ad sizes: 160x600, 250x125, 250x250, 292x60, 300x250, 500x130, 728x90.
- Make sure the whole AdControl is visible by verifying that it's not obstructed by any other objects on your page.
- You can preview your own exchange ad by setting IsTest property to true.
Why does Visual Studio 2013 give a warning that the StartTracking method is obsolete and suggest I use an AppKey as a GUID instead??
Sorry about that. It was marked obsolete by mistake. Will be fixed in the next release.
Please update the sample. The AdControl does not have AdUnitId and AppKey property anymore.
@liondev quite the contrary - these 2 properties were added not too long ago and are the current properties you have to set.
@Alan I did not see any property named AdUnitId or AppKey, just only one AppId property I have to set with Ad unit ID value.
@liondev We've noticed that this guide refers to an older SDK version. After updating to v9.x AdDuplex SDK you will be able to set AdUnitId and AppKey properties. In the meantime we'll edit the guide, sorry if this has caused you any inconvenience.