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.
Try 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
)
The option "Run each query in its own process" instructs LINQPad to use process isolation rather than AppDomain isolation. It will still re-use the process if you re-run the same query.
The option you want is "Always use fresh application domains". Set this to true, and you'll get a fresh process/AppDomain with each execution. Or, as the Guru suggested, set Util.NewProcess
in your query. This forces the next execution to use a fresh process/domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With