Hello notahack,
Windows script engines (JScript/VBScript) have thread affinity; that is, each instance can only be accessed on the thread that created it.
ClearScript supports this requirement by associating each
Depending on your application's architecture, such invocations may or may not have to be asynchronous. Here's an example of a synchronous one:
Good luck!
Windows script engines (JScript/VBScript) have thread affinity; that is, each instance can only be accessed on the thread that created it.
ClearScript supports this requirement by associating each
WindowsScriptEngine
instance with a Dispatcher
that you can use to invoke operations on the appropriate thread.Depending on your application's architecture, such invocations may or may not have to be asynchronous. Here's an example of a synchronous one:
engine.Dispatcher.Invoke(new Action(() => engine.Execute(scriptCode)));