2011-08-11 138 views
1

我第一次爲WP7創建堆棧軌跡。調試WP7崩潰

這給我帶來了特別的麻煩,並且正從我的應用的幾個用戶彈出。我需要一些幫助來破譯這個。

這是堆棧跟蹤:

Frame Image     Function                    Offset  
0  coredll.dll   xxx_RaiseException                32   
1  mscoree3_7.dll WatsonUnhandledManagedException             300  
2  mscoree3_7.dll Dbg_NotifyManagedException              136  
3  mscoree3_7.dll FirstPassException                1044  
4       TransitionStub                 0   
5       System.ThrowHelper.ThrowArgumentException           52   
6       System.Collections.Generic.Dictionary`2.Insert         344  
7       System.IO.IsolatedStorage.IsolatedStorageSettings.Add        92   
8       traffic_and_travel_uk.Services.push_settings.button4_Click      92   
9       System.Windows.Controls.Primitives.ButtonBase.OnClick        132  
10       System.Windows.Controls.Button.OnClick           120  
11       System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp     228  
12       System.Windows.Controls.Control.OnMouseLeftButtonUp        100  
13       MS.Internal.JoltHelper.FireEvent             800  
14  mscoree3_7.dll IL_CallManaged                 860  
15  mscoree3_7.dll IL_CallDelegateInternal               176  
16  mscoree3_7.dll makeComPlusCall                 984  
17  mscoree3_7.dll makeComPlusCallReturnInt               40   
    18                           0   
19  agcore.dll  CCoreServices::CLR_FireEvent              400  
20  npctrl.dll  CommonBrowserHost::CLR_FireEvent             36   
21  npctrl.dll  CControlBase::ScriptCallback              536  
22  npctrl.dll  CXcpDispatcher::OnScriptCallback             300  
23  npctrl.dll  CXcpDispatcher::OnReentrancyProtectedWindowMessage        712  
    24  npctrl.dll  CXcpDispatcher::WindowProc              408  
25  coredll.dll  SendMessageW                  96   
26  npctrl.dll  CXcpBrowserHost::SyncScriptCallbackRequest          196  
27  agcore.dll  CEventManager::RaiseControlEvents             208  
28  agcore.dll  CEventManager::Raise                320  
29  agcore.dll  CEventManager::RaiseInterleavedRoutedEvents          360  
30  agcore.dll  CInputManager::InterleaveMouseAndGesture           320  
31  agcore.dll  CInputManager::ProcessMouseInput             1768  
32  agcore.dll  CInputManager::SimulateMouse              248  
33  agcore.dll  CInputManager::ProcessGestureInput            4492  
34  agcore.dll  CInputManager::ProcessInput              440  
35  agcore.dll  CCoreServices::ProcessInput              68   
36  npctrl.dll  CXcpBrowserHost::HandleInputMessage            920  
37  npctrl.dll  CXcpControl::OnGestureEvent              460  
38  npctrl.dll  CXcpControl::ProcessWindowMessage             1868  
39  npctrl.dll  ATL::CWindowImplBaseT_ATL::CWindow,ATL::CWinTraits_1442840576,0_ _::WindowProc 140  
40  coredll.dll  DispatchMessageW 
41  TaskHost.exe  CHostActiveXModule::RunMessageLoop            424  
42  TaskHost.exe  ATL::CAtlExeModuleT_CHostActiveXModule_::Run          40   
43  TaskHost.exe  WinMain                   1420  
44  TaskHost.exe  WinMainCRTStartupHelper               60   
45  coredll.dll  MainThreadBaseFunc                428 

所以我可以看到它被陷在button4_Click功能和新增ISO存儲設置,但還有什麼是怎麼回事?我不明白是什麼造成了一些人的崩潰。

這是有問題的代碼:

private void button4_Click(object sender, RoutedEventArgs e) 
    { 
     var settings = IsolatedStorageSettings.ApplicationSettings; 
     settings.Add("FirstPush", "true"); 

     var hide = Visibility.Collapsed; 
     grid4.Visibility = hide; 
     SE_service_btn_Click1(); 
    } 

感謝。任何指導讚賞。

回答

2

看那documentationIsolatedStorageSettings.Add()

ArgumentException key already exists in the dictionary. 

使用IsolatedStorageSettings["FirstPush"] = "true"代替。這將創建或更新密鑰,如果它已經存在沒有拋出異常。

+0

非常感謝,我想這可能是它。除了在堆棧中的IsoStorage線之上的異常之外,什麼告訴你異常是由IsoStorage引起的? –

+0

那麼,該方法的文檔明確指出,如果密鑰已經存在,並且在寫入密鑰之前沒有檢查密鑰是否存在,則會引發該異常。我猜想你的應用程序在第二次按下該按鈕時會一致地出現相同的異常:-) –