Debug information?

My "query" is throwing an exception and stacktrace. It would be nice if the stacktrace included line numbers. In the past I have included a .PDB file and the line numbers appear in the stack. Is it possible to include a PDB and have LINQPad use it when generating a stacktrace? If so where would I copy it?

Comments

  • edited May 9
    Are you referring to line numbers within the assembly that you're referencing?

    If so, LINQPad does not copy over the PDB files to avoid the I/O overhead. However, there are a couple of workarounds.

    The first is to explicitly add a reference to the .PDB file (as well as the .DLL).

    The second is to go to Edit | Preferences | Advanced and set "Do not shadow assembly references" to true, and re-start LINQPad. This will stop LINQPad from copying files altogether, although it may lock the files that you reference.
  • For anyone googling, I got this to work with .NET Core 2.0 by following Joe's instructions above, but I also had to do the following for the project(s) in Visual Studio 2017:

    1) Right click the .NET project, Properties
    2) Select Build tab
    3) Click Advanced button
    4) Change Debugging Information drop-down from Portable to Full
    5) Rebuild the solution

    It looks like this action adds the following lines to the .csproj file:
    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <DebugType>full</DebugType> <DebugSymbols>true</DebugSymbols> </PropertyGroup>

    Once that was done, I see line numbers next to each file in the StackTrace!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!