use*_*632 2 asp.net stack-trace
我打开了健康监控,我有以下错误,我正在努力理解:
例外:
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)
Run Code Online (Sandbox Code Playgroud)
我只想弄清楚问题发生的确切位置和它是什么 - 它是在Repeater1_ItemDataBound子程序中发生的,还是在Timer1_Tick子程序中发生的?在跟踪的顶部或底部发生错误之前发生的最后一件事情是什么?
任何帮助非常感谢
谢谢
堆栈跟踪上的维基百科条目应该有所帮助,但基本上堆栈跟踪是线程/程序在给定时间(通常在异常期间)所处的方法/函数的列表.
堆栈跟踪中的最顶行是线程/程序"当前处于"(即当前正在执行)的方法/函数,下一行是调用上面一行中给出的方法的方法/函数,等等. ..
例如,如果我有以下代码(在C#中):
void Timer1_Tick()
{
SomeMethod();
}
void SomeMethod()
{
AnotherMethod();
}
void AnotherMethod()
{
// Suppose I have a exception / stack trace taken at this point
}
Run Code Online (Sandbox Code Playgroud)
我可能会得到以下堆栈跟踪:
AnotherMethod()
SomeMethod()
Timer1_Tick()
Run Code Online (Sandbox Code Playgroud)
简而言之 - 可能是您的错误在方法中的某个位置Repeater1_ItemDataBound
,因为这是堆栈跟踪中的"最外层"/最顶层的方法.
在您的 itemdatabound 中,但没有证据表明错误是什么,它是一个跟踪,所以第一件事是最上面(最后一个)问题,它下面的项目是到达那里所采取的路线
看起来你正在铸造一些错误的东西,也许是一个控件?例如,错误地将文本框设置为标签?