Wrong line number on stack trace

前端 未结 6 1325
不思量自难忘°
不思量自难忘° 2020-12-01 03:31

I have this code

try
{
  //AN EXCEPTION IS GENERATED HERE!!!
}
catch  
{
   SqlService.RollbackTransaction();
   throw;
}

Code above is ca

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 04:14

    Does the date/time stamp of your .pdb file match your .exe/.dll file? If not, it could be that the compilation is not in "debug mode" which generates a fresh .pdb file on each build. The pdb file has the accurate line numbers when exceptions occur.

    Look into your compile settings to make sure the debug data is generated, or if you're in a test/production environment, check the .pdb file to make sure the timestamps match.

提交回复
热议问题