C#:堆栈跟踪上的行号指向带有 } 的行
关于解决这个问题的建议?当我咨询谷歌机器时,我不断地想出“丢失”的行号,但这不是我们遇到的问题。我们有一个行号,但它除了一个右大括号之外没有指向任何东西。
难道是因为超时了?奇怪的是,它总是在方法的最后放弃,并且同样的方法也不少。超时不一定频繁,并且应用程序(调用 asmx Web 服务的 win 表单)有时会在其他地方超时。
编辑:代码和堆栈跟踪。
public DataSet GetData(...)
{
// About 18 try/catch blocks loading tables in dataset, all similar to below
try
{
// Create Table Adapter
// Fill Table
}
catch (Exception ex)
{
LogError(ex, System.Reflection.MethodBase.GetCurrentMethod(), null);
throw ex;
}
} //Line 479
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---> System.Data.SqlClient.SqlException: 超时已过。超时时间 完成之前已过去 操作或服务器不 回应。在 监控数据服务.AddAllData(数据集 数据、日期时间上次同步、字符串 PrevAreas、字符串 NewAreas、日期时间 上一个开始日期、日期时间 上一个结束日期、 日期时间新开始日期、日期时间 NewEndDate、Int32 当前用户、布尔值 属于组)中 MonitoringDataService.cs:第 479 行
值得注意的是,这是内部异常。
Suggestions on resolving this? I keep coming up with "missing" line numbers when consulting the google machine and that isn't the issue we are having. We have a line number but it doesn't point to anything but a closing brace.
Could this be because it is a timeout? It seems strange that it consistently gives up at the very end of the method, and the same method no less. The time outs are not necessarily frequent and the application (win forms calling asmx web service) does timeout in other places at times.
Edit: Code and Stack trace.
public DataSet GetData(...)
{
// About 18 try/catch blocks loading tables in dataset, all similar to below
try
{
// Create Table Adapter
// Fill Table
}
catch (Exception ex)
{
LogError(ex, System.Reflection.MethodBase.GetCurrentMethod(), null);
throw ex;
}
} //Line 479
System.Web.Services.Protocols.SoapException:
System.Web.Services.Protocols.SoapException:
Server was unable to process request.
---> System.Data.SqlClient.SqlException:
Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding. at
MonitoringDataService.AddAllData(DataSet
Data, DateTime LastSync, String
PrevAreas, String NewAreas, DateTime
PrevStartDate, DateTime PrevEndDate,
DateTime NewStartDate, DateTime
NewEndDate, Int32 CurrentUser, Boolean
IsInGroup) in
MonitoringDataService.cs:line 479
Worth noting that this is the inner exception.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能的原因:
抛出新异常(...)
之后的行Likely causes:
throw new exception(...)
很可能它并不是在端括号上真正出错,而是在它之前的行上出错。
More than likely it's not really erroring on the end brace, but the line before it.