none
[UWP] - AdControl doesnt work RRS feed

  • Question

  • Hello, 

    I try to add Advertisments to my app. I used this official instruction:

    https://docs.microsoft.com/en-us/windows/uwp/monetize/adcontrol-in-xaml-and--net

    I added a nuget package Microsoft.Advertising.XAML

    I added a in MainPage.XAML code 

        xmlns:ad="using:Microsoft.Advertising.WinRT.UI"

    I added, AdControl in XAML

            <ad:AdControl ApplicationId="3f83fe91-d6be-434d-a0ae-7351c5a997f1"
                  AdUnitId="test"
                  HorizontalAlignment="Left"
                  Height="250"
                  VerticalAlignment="Top"
                  Width="300"/>

    Now app doesnt see the AdControl element.

    In compilation I have error:

    Unknown type 'AdControl' in XML namespace 'using:Microsoft.Advertising.WinRT.UI'

    How to add an AdControl to the App.


    • Moved by Xavier Xie-MSFT Monday, July 29, 2019 8:41 AM move to correct forum
    Thursday, July 25, 2019 10:56 AM

All replies

  • Hi BitSmithy,

    If you install the Microsoft Advertising SDK via NuGet, please make sure that you have followed the seven steps on the document.

    Best Regards,

    Xavier


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 25, 2019 1:21 PM
  • I did all seven steps (I installed the SDK first time in this project). 

    App doesn't see the 'AdControl'

    Monday, August 19, 2019 9:14 PM