2010-01-21 98 views
1

我有健康監控開啓,我有以下的錯誤我試圖理解:幫助理解該堆棧跟蹤

例外:

Exception information: 
    Exception type: System.InvalidCastException 
    Exception message: Specified cast is not valid. 


Thread information: 
    Thread ID: 5 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace: at _Default.Repeater1_ItemDataBound(Object sender, RepeaterItemEventArgs e) 
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) 
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) 
    at _Default.up1_Load() 
    at _Default.Timer1_Tick(Object sender, EventArgs e) 
    at System.Web.UI.Timer.OnTick(EventArgs e) 
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

我只是想弄清楚到底發生問題的地方是什麼 - 是發生在Repeater1_ItemDataBound子例程還是Timer1_Tick子例程中?在跟蹤的頂部或底部發生錯誤之前發生的最後一件事情是什麼?

任何幫助非常感謝

感謝

回答

0

在你的ItemDataBound但沒有的錯誤是什麼,它的痕跡所以第一次的事情是最上層(最後)問題和證據它下面的項目是它走到那裏的路線

它看起來像你投了錯,也許是一個控制?如文本框錯誤的標籤?

4

從底部到頂部閱讀 - 發生異常的功能位於頂部。

7

堆棧跟蹤上的wikipedia entry應該會有所幫助,但本質上堆棧跟蹤是線程/程序在給定時間(通常在異常期間)處於的方法/函數列表。

堆棧跟蹤中最頂部的一行是線程/程序「正在進入」(即當前正在執行)的方法/函數,下一行是調用行中給出方法的方法/函數以上,等...

因此,舉例來說,如果我有以下代碼(C#):

void Timer1_Tick() 
{ 
    SomeMethod(); 
} 

void SomeMethod() 
{ 
    AnotherMethod(); 
} 

void AnotherMethod() 
{ 
    // Suppose I have a exception/stack trace taken at this point 
} 

我可能會遇到以下堆棧跟蹤:

AnotherMethod() 
SomeMethod() 
Timer1_Tick() 

在笑rt - 它可能是您的錯誤在方法Repeater1_ItemDataBound中的某處,因爲這是堆棧跟蹤中的「最外層」/最頂層的方法。