Confusion with Line Numbers.

MarkLFT

Posted on
May 02 2013

Can you please tell me how you determine the line number for an exception. The reason I ask is in some cases the Line Numbers seem to be inaccurate, please take the example below.

This stack trace is from one of libraries, it indicates the problem is reported from line 640, the problem is the entire class only has 428 lines, and the method named starts at line 70 and ends at 240.

Is there anything we can do to increase the accuracy of the line number in already deployed applications?

#8ZK.#7ZK #pmc(String #A2Tb, String #K12b, String #aLPb, Boolean #NMrc):297

8ZK.#pmc #89K(String #1Z, String #y0, FieldPair #M9rc, Boolean #N9rc):97

8ZK.#pmc #89K(IComparable #WfVb, IComparable #H12b, FieldPair #M9rc, Boolean #N9rc, Boolean #O9rc):397

RedGate.SQLDataCompare.Engine.ResultsStore.Store IdenticalValues(Object value1, Object value2, FieldPair fieldPair, Boolean forceBinaryString, Boolean roundDoubles, Boolean treatEmptyStringAsNull):434 RedGate.SQLDataCompare.Engine.ComparisonSession #paL(Int32 #39rc, Object[] #09rc, Object[] #19rc, IList1 #49rc, DifferencesSummary #59rc, Byte[] #29rc, Boolean #N9rc, Boolean #O9rc, Boolean #69rc):17 RedGate.SQLDataCompare.Engine.ComparisonSession #maL(#H1K #X9rc, #H1K #Y9rc, TableMapping #3Krc, ProgressPercentageTracker #luPb):0 RedGate.SQLDataCompare.Engine.ComparisonSession CompareDatabases(Database db1, Database db2, TableMappings mappings, SessionSettings sessionSettings, Boolean doNotBeDefeated):1570 RedGate.SQLDataCompare.Engine.ComparisonSession CompareDatabases(Database db1, Database db2, TableMappings mappings, SessionSettings sessionSettings):0 RedGate.SQLDataCompare.Engine.ComparisonSession CompareDatabases(Database db1, Database db2, TableMappings mappings):0 RedGateWrapper.SQLDataCompare SynchronizeData(IList1 tableNames, SelectionDelegateType delegateType, TableMappingsType mappingsType, MappingOptions mappingOptions, Boolean applyWhereClause):640


martin308

Posted on
May 03 2013

Hi Mark,

You can see in this file how we determine the line number. If .Net is unable to determine the file line number then we use the IL offset. If you do not have the PDB files alongside the DLLs then .Net will be unable to determine the file line number. If you are not including the PDB files then including them will help with line number determination.

Hope that helps


Reply