1
Vote

AdRotator WP 1.1.0-Beta - TypeInitializationException

description

Be it the emulator or a actual WP7 device, the Adrotator control will occasionally throw a System.TypeInitializationException: TypeInitializationException when the AdRotator.AdRotatorControl.InvalidateAd(Boolean selectNextAdType) is called in the code-behind. This will crash the app upon Page_Load (as it can happen during startup or returning back to the view(, even if it is inside of a try/catch block. It also produces a "No Symbols Loaded" error with "AdRotator.pdb not loaded" in debug mode. All of the available ad service libraries are in my app, and the Google AdMob has been removed from my config files so it isn't being referenced (the original WP7 dll is installed though). I've tried changing the DefaultAdType to AdDuplex, Smaato (since it seems to be the most reliable so far) and None to see if a lack of ads might be causing the situation, but nothing prevents the error from occurring.

System.TypeInitializationException was unhandled
Message=TypeInitializationException
TypeName=""
StackTrace:
   at AdRotator.AdRotatorControl.InvalidateAd(Boolean selectNextAdType)
   at AdRotator.AdRotatorControl.<>c__DisplayClass3.<Invalidate>b__1()
   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.Delegate.DynamicInvoke(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.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
   at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)

comments