Offline Exception

Aug 30, 2012 at 8:10 AM

Hi Mark,

I have gotten few error reports (+- 50) from my published application with an exception in the Advert Control. I'm not 100% sure what is causing it and I have not managed to replicate the issue. From the code it seems that it is happening when it tries to show the offline content.

The exception is as follows:

 at MS.Internal.XcpImports.CheckHResult(UInt32 hr)   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)   at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)   at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)   at System.Windows.Controls.Control.set_DefaultStyleKey(Object value)   at System.Windows.Controls.ContentControl..ctor()   at MS.Internal.CoreTypes.GetCoreWrapper(Int32 typeId)   at MS.Internal.ManagedPeerTable.EnsureManagedPeer(IntPtr unmanagedPointer, Int32 typeIndex, Type type, Boolean preserveManagedObjectReference)   at MS.Internal.XcpImports.ConvertDO(IntPtr doPointer, Int32 typeIndex, Boolean releaseObjectReference)   at MS.Internal.XcpImports.ConvertType(CValue outVal, Int32 typeIndex, Boolean releaseObjectReference, Boolean deleteBuffer, IManagedPeerBase fromObject)   at MS.Internal.XcpImports.ConvertCValueForManagedWithType(Type propertyType, CValue& outVal, Int32 outDOType, Boolean releaseObjectReference, Boolean deleteBuffer, IManagedPeerBase fromObject)   at MS.Internal.XcpImports.ConvertCValueForManaged(DependencyProperty property, CValue& outVal, Int32 outDOType, IManagedPeerBase fromObject)   at MS.Internal.XcpImports.GetValue(IManagedPeerBase managedPeer, DependencyProperty property)   at System.Windows.DependencyObject.GetValueInternal(DependencyProperty dp)   at System.Windows.FrameworkElement.GetValueInternal(DependencyProperty dp)   at System.Windows.FrameworkElement.get_Parent()   at MC.Phone.Ads.Provider.GenericAdProviderForXaml.<ShowOfflineContent>b__9()   at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)   at System.Delegate.DynamicInvokeOne(Object[] args)   at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)   at System.Windows.Threading.DispatcherOperation.Invoke()   at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)   at System.Windows.Threading.Dispatcher.OnInvoke(Object context)   at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)   at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult   

I thought that maybe the Parent item could be null in the GenericAdProviderForXaml.cs, but I'm not sure how that could be the case?

I was wondering if you have seen this before or have any idea on what could be causing this/how to fix it?

BTW, I see that Google have updated their AdMob library that fixes the UI locking issues that it had. You can check it out here and it may be worth while including this new version into the source.



Aug 30, 2012 at 8:31 AM

Hi Mauro,

I haven't seen this particular error, though it's quite an internal error that we can see. Do you have special things in your offline content?


Hmm, I'm still seeing the AdMob 4.0.4 version, are you too? I'm still hoping for a fixed version.



Mark Monster

Aug 30, 2012 at 9:15 AM

Hi Mark,

As far as I know there is nothing special in my offline content. Here is it, maybe you can spot something I'm doing wrong?

	<Grid Width="480"
		  Background="{StaticResource PhoneBackgroundBrush}">
		<Border BorderBrush="{StaticResource PhoneForegroundBrush}"
					<TextBlock FontFamily="{StaticResource PhoneFontFamilySemiBold}"
							   Style="{StaticResource PhoneTextNormalStyle}"
							   Text="APP NAME"
							   TextAlignment="Center" />

					<TextBlock Foreground="{StaticResource PhoneDisabledBrush}"
							   Style="{StaticResource PhoneTextSmallStyle}"
							   Text="APP DETAILS"
							   TextWrapping="Wrap" />


Hmmm...sorry about the AdMob Control update it seems that there hasn't been an update from what you have. I seem to have created this confusion when I went to the site and looked at the release notes, which only specifies V4.0.1 as the latest ( I then looked at the changelog in the Zip download and it mentioned "Moved more work off of the UI thread to make apps more responsive" which I thought was the issue we have been seeing. I didn't actually check the version you were using, so I guess it a bad move from my side...Sorry about that :)