OOB when offline does not work in MSAF

Apr 12, 2012 at 10:59 AM

Hi,

As per the documentation i have the included the following code in App.xaml

  1. <Application.ApplicationLifetimeObjects>
        <mwa:WebAnalyticsService/>
    </Application.ApplicationLifetimeObjects>

In OOB follow the following steps:

1) Make the application offline.

2) Perform some action on control having trackaction decorated with say button.

3) Close the application. At this instance, the tracked data will be writtem in isolated storage. This is working fine.

4) Open the application in online mode. At this point the data in the isolated storage must be send over the wire. but it doesn't. It doe seem to read the isolated storage but simply does not send the data.

Looking closely at the code it seems, that the TrackEvent in "DispatchEvents" method (WebAnalyticsEvents class) is null in the above scenario. This is because at the instance when the Dispatch event is fired the root visual property is not set with the mainpage object. The "root visual" property is set on the app_startup method of the silverlight application. This event is fired after the WebAnalyticsService has been initialized. 

If this happens then as per the code , the "Initialize" method in datacollector.cs class is executed even before the main page is initialized. The DispatchCachedEvents event in the initialize method would have tried to send the data over wire but since the trackevent is null it does not work.

Jan 5 at 5:56 AM