2011-05-19 79 views
0

雖然不是所有時間,但我正在通過簡單的NavigationService調用收到參數超出範圍的異常。使用NavigationService的範圍異常參數

NavigationService.Navigate(New Uri("/MainPage.xaml", UriKind.Relative)); 

這在大多數情況下都能正常工作,但是偶爾會失敗並說參數無效。如果你注意到。沒有任何自負都是失敗的。我猜可能還有其他一些例外?不知道它會是什麼。我看過谷歌和這裏,並沒有看到過類似的例子。任何理想的讚賞。

這是堆棧跟蹤。

System.Windows.dll!System.Windows.Threading.DispatcherTimer.Interval.set(System.TimeSpan value) + 0x10 bytes  
    Microsoft.Advertising.Mobile.UI.dll!Microsoft.Advertising.Mobile.UI.AdControl.PauseTimer() + 0x77 bytes 
    Microsoft.Advertising.Mobile.UI.dll!Microsoft.Advertising.Mobile.UI.AdControl.DeactivateAdControl() + 0x1d bytes  
    Microsoft.Advertising.Mobile.UI.dll!Microsoft.Advertising.Mobile.UI.AdControl.OnApplicationPageDeactivated(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) + 0x39 bytes 
    Microsoft.Phone.dll!System.Windows.Navigation.NavigationService.RaiseNavigating(System.Uri uri, System.Windows.Navigation.NavigationMode mode, bool isFragmentNavigationOnly, Microsoft.Phone.Controls.PhoneApplicationPage existingContentPage) + 0x1c bytes 
    Microsoft.Phone.dll!System.Windows.Navigation.NavigationService.Navigate(System.Uri source) + 0x178 bytes 
+1

是在頁面加載,navigatedto或其他初始化期間頁面失敗的東西嗎?由於它是間歇性的,它可能與頁面/對象狀態有關。檢查堆棧跟蹤和任何內部異常以查看是否可以找到哪條線實際上拋出錯誤。 – theChrisKent 2011-05-19 21:02:51

+0

所以沒有內在的例外。但是這裏是堆棧跟蹤。也許是線程問題,但我不知道真正的例外是什麼。往上看。 – firebellys 2011-05-20 19:48:55

回答