WP7 ConsoleAnalytics crash

Jan 15, 2011 at 7:12 AM
Edited Jan 15, 2011 at 7:13 AM

I'm adding analytics to my WP7 project and seem to be unable to get anything to display in the debug console.  I am compiling in debug mode and have attached consoleanalyics to the layout panel in my main page.  I went through the WP7 setup in the documentation.

If I press on a control, the control behavior is correct (although I see nothing in the output window).  But if I press the back button and tap on the control again, I get a crash.  Call stack:

System.Windows.Interactivity.dll!System.Windows.Interactivity.Interaction.GetBehaviors(System.Windows.DependencyObject obj = null) + 0x6 bytes

Microsoft.WebAnalytics.Behaviors.dll!Microsoft.WebAnalytics.Behaviors.ConsoleAnalytics.OnAttached.AnonymousMethod__0(object sender = {System.Windows.Controls.Grid}, System.Windows.RoutedEventArgs args {System.Windows.RoutedEventArgs}) + 0x6 bytes  

System.Windows.dll!System.Windows.CoreInvokeHandler.InvokeEventHandler(int typeIndex = 160, System.Delegate handlerDelegate = {System.Windows.RoutedEventHandler}, object sender = {System.Windows.Controls.Grid}, object args = {System.Windows.RoutedEventArgs}) + 0x362 bytes  

 System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj = 71977648, System.IntPtr unmanagedObjArgs = 93506240, int argsTypeIndex = 160, string eventName = "M@10") + 0x161 bytes   [Native to Managed Transition]


Does anyone have any ideas?

Jan 17, 2011 at 5:30 PM
  1. For Windows Phone, you don't put the analytics services in the scene, but in the App.xaml as shown in the Documentation How-to section.
  2. You should compile the source code for the ConsoleAnalytics directly into your project, as the ConsoleAnalytics behavior in the framework is built in release mode.