Search code examples
linqpad

Do NOT reuse query process in LINQPad


I have "Run each query in its own process" option turned on (default value), but it seems that the process is being reused between query runs (LINQPad.UserQuery.exe keeps running).

Is there a way to avoid this reuse? I need a fresh process every time (due to JVM usage).

Obvious way is

Environment.Exit(0);

but it results in unpleasant "Query ended unexpectedly" message.


Solution

  • You can use Util.NewProcess = true:

    Util.NewProcess = true;
    Process.GetCurrentProcess().Id.Dump();
    

    Also you can try option from menu: 'Query' -> 'Cancel All Threads and Reset' (also available via shortcut Shift+Control+F5)