Line numbers in stack trace

Tony Chamberlain 1 Reputation point
2021-07-01T10:32:16.7+00:00

I am using VS 2012 11.0.61219 and I keep getting an error about an item not set to an instance. It shows a stack backtrace but does not show line numbers on any of the methods. On the methods, there are several places where this could be occurring, but without the line numbers I cannot tell. How can I turn line numbers on?

Not sure it helps or not but this is using C# with Test Complete Connected Apps.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,957 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,626 Reputation points
    2021-07-08T05:29:00.397+00:00

    Hi TonyChamberlain-2874,
    First,you need to know that changing the build settings in Visual Studio 2012 will not work.
    You can try the suggestions in this thread.

    <PropertyGroup>  
      <ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>  
    </PropertyGroup>  
    

    And you can also write a custom Stack Trace Explorer which that you could show the line number.
    More details you can refer to this link.

    var lineNumber = TextDocument.GetLineByOffset(context.VisualLine.StartOffset).LineNumber;  
    

    More solutions in this thread you can refer to.
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.