Add the ability to step/debug through #load-ed files

I'm making heavy use of the #load directive to include classes from other linq files. This is great since it allows me to create organized libraries of reusable code within linqpad without throwing them all in my My Extensions file.

But currently, classes defined in a loaded file are treated as black boxes like other external references. We cannot step into the code for those classes but could jump to the definitions. It does seem to be aware of those files looking at the call stack, just can't debug it.


  • Options

    There are a number of difficulties in allowing debugging through #load-ed files, one of which is how the manage the user interface. Bear in mind that the query that you're #load-ing can also run (and be debugged) at the same time - and other queries can #load the same query and they can also be debugged concurrently. To work around this, LINQPad would need to create another view of the #load-ed query inside the main query, which would be very complicated to implement.

  • Options

    A very much nice-to-have feature!

  • Options

    Is there any workaround to debug "#load-ed" files?

    Right now, I have to copy all file content into current query. After debugged, I remove those code from current query. It's a bit inconvenient.

  • Options

    I did that once or twice, but when I needed to debug a script that loaded ten other scripts, I decided to write an Automator script to automatically create and open a merged script (which was saved to the temporary folder).
    I can then debug the merged script.

    Very much a hack and the biggest problem is that if the main script has been changed and not been saved then the merged script will not contain the changes.

    Also I have to be careful if I change the merged script that I remember to copy the changes back to the original file.

Sign In or Register to comment.