简体   繁体   中英

C#: Line number on stacktrace points to line with a }

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.

Likely causes:

  • The code that is running is different from the source you are debugging from. This is the most likely cause.
  • Line could be the line after a throw new exception(...)

更有可能的是它并不是真正的错误,而是在它之前的线。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM