2
Vote

Object reference not set to an instance of an object. at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.SelectNextRandomAdProvider(IObserver`1 observer, AdEventArgs adSelectionCause)

description

Hello,

I receive a lot of "Object reference not set to an instance of an object." error
  • with this stack trace:
    at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.SelectNextRandomAdProvider(IObserver1 observer, AdEventArgs adSelectionCause)
    at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<ProvideNext>b__6(IObserver
    1 observe)
    at MC.Phone.Ads.Rx.AnonymousObservable1.Subscribe(IObserver1 observer)
    at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass170`1.<>c__DisplayClass172.<SubscribeOn>b__16f(Object _)
  • and sometimes the same error with this stack trace:
    at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.SelectNextRandomAdProvider(IObserver1 observer, AdEventArgs adSelectionCause)
    at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<>c__DisplayClass21.<ProvideNext>b__12(String xmlString)
    at Microsoft.Phone.Reactive.AnonymousObserver
    1.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
    at Microsoft.Phone.Reactive.AnonymousObservable
    1.AutoDetachObserver.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
    at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2b6
    2.<>c__DisplayClass2b8.<Select>b__2b5(TSource x)
    at Microsoft.Phone.Reactive.AnonymousObserver1.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver
    1.OnNext(T value)
    at Microsoft.Phone.Reactive.AnonymousObservable1.AutoDetachObserver.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver
    1.OnNext(T value)
    at System.Action1.Invoke(T obj)
    at Microsoft.Phone.Reactive.AnonymousObserver
    1.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
    at Microsoft.Phone.Reactive.AnonymousObservable
    1.AutoDetachObserver.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
    at System.Action
    1.Invoke(T obj)
    at Microsoft.Phone.Reactive.AnonymousObserver1.Next(T value)
    at Microsoft.Phone.Reactive.AbstractObserver
    1.OnNext(T value)
    at Microsoft.Phone.Reactive.AnonymousObservable`1.AutoDetachObserver.Nex
I could not reproduce the error, I just recive it on my own error logging from users.
Will be any fix on this?

Thanks,
Tom

comments

mkamonster wrote May 22, 2014 at 7:12 AM

Interesting, haven't seen this happening. Do you know if this is happening on a particular device or OS version?

pubtom wrote May 23, 2014 at 8:08 AM

Hello Mark,

Thanks for your reply!

I checked my stat and it is not related to device versions. For OS versions:
The first exception somehow very often in the WP 8.0 OS.
The second exception is not related to OS version.

1.) Which contains
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<ProvideNext>b__6(IObserver1 observe) in the StackTrace has 21383 occurences in the last month (30 days)
50 of them are from WP 8.1
21151 of them are from WP 8.0
182 of them are from WP 7.1

2.) Which contains MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<>c__DisplayClass21.<ProvideNext>b__12(String xmlString) in the StackTrace has 113741 occurences in the last month (30 days)

164 of them are from WP 8.1
77220of them are from WP 8.0
36357 of them are from WP 7.1

On WP7 devices the exception message is NullReferenceException
On WP8 devices the exception message is Object reference not set to an instance of an object

Thanks,
Tom

pandrew wrote May 31, 2014 at 6:24 PM

I also get a large number of these exceptions reported by my users. I'm sorry to say I don't understand this part of the code. Here's a stack trace in case it helps along with my debug details. The app ran for 18 seconds before this error. Unfortunately this never happens for me, only for my users so super hard to debug. Keen to hear any debug ideas.

Uptime: 00:00:18.0512631
NOKIA, RM-914_eu_euro1_387, 414617600, 3056.40000.1349.2005
MainPage UnhandledException
Object reference not set to an instance of an object.
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.SelectNextRandomAdProvider(IObserver1 observer, AdEventArgs adSelectionCause)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<>c__DisplayClass3d.<SelectNextRandomAdProvider>b__33(IEvent
1 e)
at Microsoft.Phone.Reactive.AnonymousObserver1.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(T value)
at Microsoft.Phone.Reactive.AnonymousObservable1.AutoDetachObserver.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(T value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2db1.<>c__DisplayClass2e0.<Take>b__2da(TSource x)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
at Microsoft.Phone.Reactive.AnonymousObservable
1.AutoDetachObserver.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2c2
1.<>c__DisplayClass2c4.<Where>b__2c1(TSource x)
at Microsoft.Phone.Reactive.AnonymousObserver1.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(T value)
at Microsoft.Phone.Reactive.AnonymousObservable1.AutoDetachObserver.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(T value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2c21.<>c__DisplayClass2c4.<Where>b__2c1(TSource x)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
at Microsoft.Phone.Reactive.AnonymousObservable
1.AutoDetachObserver.Next(T value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(T value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass1a8
1.<>c__DisplayClass1aa.<FromEvent>b__1a5(Object sender, TEventArgs eventArgs)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.RaisePropertyChanged(String propertyName)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.set_Paused(Boolean value)
at MC.Phone.Ads.AdControl.NextAdProvider()
at MC.Phone.Ads.AdControl.ProvideAd()
at MC.Phone.Ads.AdControl.NavigationBehavior(NavigatingCancelEventArgs e)
at MC.Phone.Ads.AdControl.<OnLoaded>b__1(AdControl instance, Object source, NavigatingCancelEventArgs args)
at MC.Phone.Ads.Utils.WeakEventListener`3.OnEvent(TSource source, TEventArgs eventArgs)
at System.Windows.Navigation.NavigatingCancelEventHandler.Invoke(Object sender, NavigatingCancelEventArgs e)
at System.Windows.Navigation.NavigationService.RaiseNavigating(Uri uri, NavigationMode mode, Boolean isFragmentNavigationOnly, Boolean isCancelable, Boolean isNavigationInitiator, IPhoneApplicationPage existingContentPage)
at System.Windows.Navigation.NavigationService.Journal_NavigatedExternally(Object sender, JournalEventArgs args)
at System.Windows.Navigation.Journal.OnNavigatedExternally(String name, Uri uri, NavigationMode mode)
at System.Windows.Navigation.Journal.DoExternalNavigation(NavigationDirection direction, Boolean isResumeActivation)
at System.Windows.Navigation.Journal.NavigateTo(NavigationDirection direction, Boolean isResumeActivation)
at Microsoft.Phone.TaskModel.Interop.Task.FireOnNavigateTo(Int32 direction, Boolean isResumeActivation)

wrote May 31, 2014 at 6:24 PM

pubtom wrote Jul 15, 2014 at 2:58 PM

Stack trace:

at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.ParseXml(String xml)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<>c__DisplayClass21.<ProvideNext>b__12(String xmlString)
at Microsoft.Phone.Reactive.AnonymousObserver1.Next(String value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(String value)
at Microsoft.Phone.Reactive.AnonymousObservable1.AutoDetachObserver.Next(String value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(String value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2782.<>c__DisplayClass27a.<Select>b__277(MemoryStreamWithOrigin x)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AnonymousObservable
1.AutoDetachObserver.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver`1.OnNext(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reac...

pubtom wrote Jul 15, 2014 at 2:59 PM

Stack trace 2.:

at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDeclaration..ctor(XmlReader r)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.ParseXml(String xml)
at MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.<>c__DisplayClass21.<ProvideNext>b__12(String xmlString)
at Microsoft.Phone.Reactive.AnonymousObserver1.Next(String value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(String value)
at Microsoft.Phone.Reactive.AnonymousObservable1.AutoDetachObserver.Next(String value)
at Microsoft.Phone.Reactive.AbstractObserver
1.OnNext(String value)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass2782.<>c__DisplayClass27a.<Select>b__277(MemoryStreamWithOrigin x)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AnonymousObservable
1.AutoDetachObserver.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver1.OnNext(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AnonymousObserver
1.Next(MemoryStreamWithOrigin value)
at Microsoft.Phone.Reactive.AbstractObserver`1.OnNext(Me...