Using the Visual Studio 2010 Visual Designer
The following steps are a guide to using the Visual Studio 2010 Visual Designer to integrate advertising into Windows Phone applications.
Prerequisites
Integrate an AdControl into an Application by Using the Visual Studio 2010 Visual Designer
-
Open Visual Studio and create a new project.
-
From the installed templates section (on the left), expand Visual C# and click Silverlight for Windows Phone.
-
Select the type of application you are building—for example, Windows Phone Application.
-
Name the project (for example, AdControlTest), and click OK.
-
In the Toolbox, you should see the AdControl in the Windows Phone Controls tab.
-
Drag and drop the AdControl into the Application Designer. Position the AdControl so that it is fully visible in the Application Designer.
-
In the Application Designer, right-click the AdControl. On the context menu, click Properties.
-
You should now see the AdControl properties in the Visual Studio Properties panel.
-
Set the control size either by dragging and dropping the border in the designer or by specifying the size in the Properties pane.For example,
Width = 480, Height = 80.
-
You can use test IDs to see how the ads will look in your application. In the Properties panel, configure the following properties:
-
Set
AdUnitIdtoImage480_80. For more information about test values, see Test Values for AdUnitId and ApplicationId.
-
Set
ApplicationIdtotest_client. For more information about test values, see Test Values for AdUnitId and ApplicationId.
-
Set
-
Run your application and you will see a sample test ad.
In order to receive live ads, you will need to register with Microsoft pubCenter. For more information, see Getting Access to Microsoft pubCenter and Receiving Ads.
After registration, you will receive an official ApplicationId and AdUnitId to use in the AdControl.
See Also
Send feedback about this documentation to adsfdbk@microsoft.com.
Publication date: 2012-03-09
Have we to add code to handle this kind of issue or not anymore?
- 12/13/2011
- Lovo and Lovo
- 11/14/2011
- Ron Grant - MSFT
- 8/25/2011
- J Short