question

andyfx-9341 avatar image
0 Votes"
andyfx-9341 asked ·

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

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).

windows-uwpwindows-uwp-xaml
· 8
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Since the ads are working as expected and are displayed fine, then there should be no problem in the code of AdControl. It may be something else in xaml caused this issue. Can you provide a simple sample that can be reproduced for us to test?

0 Votes 0 ·

I just wrote an answer... but on my post not on your reply by accident (don't know if you can move that) . ;) So please, feel free to look over that... thank you ;)

0 Votes 0 ·

OK, so have you solved your issue?

0 Votes 0 ·
Show more comments

1 Answer

andyfx-9341 avatar image
0 Votes"
andyfx-9341 answered ·

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.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.