Why do I see XamlParseException, only in appcenter logs? Related to Ad-Control

andy_fx 1 Reputation point
2020-01-29T12:59:46.02+00:00

Hello,

I'm seeingtons of crashes (if they're real?) in appcenter:

Windows.UI.Xaml.Markup.XamlParseException: XAML parsing failed  

I narrowed it down to:

XamlTypeInfoProvider.Activate_66_HubPage () D:\...\x64\Release\XamlTypeInfo.g.cs at 525:48  

Which finally points to:

 private object Activate_62_AdControl() { return new global::Microsoft.Advertising.WinRT.UI.AdControl(); }  

Otherwise the ads are working as expected and are displayed fine (also in different OS Language Setups). Despite those logs from appcenter as above, as explained.

So those "crashes" have somewhat to do with the AdControl in specific circumstances.

But why?
Are they being blocked?

Does anybody else has this problem (searched a lot.. but only found other generic xaml error posts).

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. andy_fx 1 Reputation point
    2020-01-30T08:05:42.707+00:00

    Sure thing... it's mainly just XAML:

    <ui:AdControl
    x:Name="adControl"
    ApplicationId="..."
    AdUnitId="..."
    ErrorOccurred="OnAdError"
    Height="90"
    Width="728" HorizontalAlignment="Center"/>

    The only thing I'm doing in code behind , is checking wether the user has bought an AddOn that makes the ads go away. In that case I set visibility of "adControl" to collapsed.

    Example:

    await ProductCheck.CheckForProducts();  
    AdContainer.Visibility = !ProductCheck.UserOwnsProducts ? Visibility.Visible : Visibility.Collapsed;  
    adControl.Opacity = 1f;  
    
     
    

    Where "ProductCheck" is just a helper method which talks back addons the user owns.
    I'm doing this on navigatedTo and right after InitializeComponent().
    But never seen those errors on my testing machines... addons purchased or not.

    0 comments No comments