Util.CurrentQueryPath remains null after saving (v5)

- Util.CurrentQueryPath returns null directly after saving

Steps to reproduce:
- Open new query window
- Enter expression: Util.CurrentQueryPath
- Run query (output = null, expected)
- Save query
- Run query (output = null, NOT expected)
- Switch tab (forth and back)
- Run query (output = null, NOT expected)
- Unload query process (SHIFT-F5)
- Run query (output = null, NOT expected)

Tested in:
- v4.55.03 => OK
- v4.57.02 => OK
- v5.02.03 => NOT OK

Tested on:
- Windows 10
- Windows 2012R2

- Close and reopen query


  • Same issue with
    Util.NewProcess = true;
    also makes no difference (changing to a statements query and adding ".Dump();" to the above). But one time I tested I got the random "Invalid handle" error that LINQPad 5 sometimes gives, and then running the query again gave the correct location.

    Another workaround I found is to modify the query in some way (add a space at the end for example) after saving it and then run it.

    Tested on Windows 7, LINQPad v5.02.03.
  • Confirmed, editing query after saving produces correct result.
  • Tested, works correctly. Thanks Joe!
  • edited June 2017
    Saving the query made it work. Is there a way to get the queries folder without saving the script ?
  • The 'My Queries' location is in My Documents\LINQPad Queries, unless you've customized. You can determine the custom folder location by reading %appdata%\linqpad\querypath.txt
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!