title: Tracking the root cause of Invalid Pointer exception on Window Universal app targeting Windows Phone
body: <p>To give you some background this is a C# Windows Universal app, which was initially developed for the Windows Tablet but with Windows Phone in mind, at a later date.  The time has come and we are making changes (tweaking views, viewmodels and etc) to allow the app to run on Windows Phone.  When the app is run during the initial startup I get an unhandled NullReference exception (mentioned below) from time to time.  If I get past the initial startup then the app runs successfully, otherwise I get the Windows un-customised splash screen (grey screen with the cross) indefinitely.  Using mixed debugging (native and managed) I managed to get some call stack information.  It seems to be related to windows.ui.xaml.dll (version 6.3.9651.0 winbluephone_rtm_sdk.140409-1600), however I do not have the symbol information for this dll as it's not on Microsoft's symbol server.  Any ideas on what is going on?</p>
  
  <p><strong>Exception</strong>
  {Windows.UI.Xaml.UnhandledExceptionEventArgs}
      Exception: {System.NullReferenceException: Object reference not set to an instance of an object.}
      Handled: false
      Message: "Invalid pointer\r\n"</p>
  
  <p><strong>Call Stack</strong>      SeB.Reader.WindowsPhone.exe!SeB.Reader.App.InitializeComponent.AnonymousMethod__3b(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) Line 50    C#
      [Native to Managed Transition]<br>
      WINDOWS.UI.XAML.DLL!6cf3a6cb()  Unknown
      [Frames below may be incorrect and/or missing, no symbols loaded for WINDOWS.UI.XAML.DLL]<br>
      WINDOWS.UI.XAML.DLL!6cf3a6cb()  Unknown
      WINDOWS.UI.XAML.DLL!6cf3a7e0()  Unknown
      WINDOWS.UI.XAML.DLL!6cf4c993()  Unknown
      WINDOWS.UI.XAML.DLL!6cf4c8c8()  Unknown
      WINDOWS.UI.XAML.DLL!6cf4c51c()  Unknown
      WINDOWS.UI.XAML.DLL!6cf4c39b()  Unknown
      TWINAPI.APPCORE.DLL!752d8724()  Unknown
      TWINAPI.APPCORE.DLL!752d8755()  Unknown
      TWINAPI.APPCORE.DLL!752d1526()  Unknown
      TWINAPI.APPCORE.DLL!752d0ae5()  Unknown
      TWINAPI.APPCORE.DLL!752d60dc()  Unknown
      TWINAPI.APPCORE.DLL!752d614b()  Unknown
      COMBASE.DLL!772caad4()  Unknown
      COMBASE.DLL!772cb0d5()  Unknown
      WINDOWS.UI.XAML.DLL!6cf4caac()  Unknown
      WINDOWS.UI.XAML.DLL!6cb070cc()  Unknown</p>