Hi Jaskaran,
If
In any case, try the following in a console application:
This code should work with older versions of ClearScript.
Thanks!
If
ScriptEngine.Current
is undefined, you're using a relatively old version of ClearScript, and we recommend that you switch to the latest version.In any case, try the following in a console application:
engine.Script.Quit = new Action(() => engine.Interrupt()); engine.AddHostType("Console", typeof(Console)); try { engine.Execute(@" call Console.WriteLine(""Before"") call Quit call Console.WriteLine(""After (shouldn't get here)"") "); } catch (ScriptInterruptedException) { }
Thanks!