Microsoft.ClearScript.Windows.Core VBScriptEngine - initializing. #347
-
Hi All, How to initialize VBScriptEngine() in windows core? The constructor takes argument Isynclnvoker. How do I initialize the IsyncInvoker when creating vb script instance .NET core. For example: /* Code example */ public VBScriptEngine GetVBSCriptEngine() Please advise. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @inavnapro, Like all Windows Script engines, VBScript has thread affinity, meaning that each instance can only be used on the thread that created it. Any attempt to use the script engine on the wrong thread results in an exception or possibly a crash. ClearScript provides two managed wrappers for VBScript: The first class doesn't require an external implementation of The other class allows the host to enforce thread affinity externally by implementing Good luck! |
Beta Was this translation helpful? Give feedback.
Hi @inavnapro,
Like all Windows Script engines, VBScript has thread affinity, meaning that each instance can only be used on the thread that created it. Any attempt to use the script engine on the wrong thread results in an exception or possibly a crash.
ClearScript provides two managed wrappers for VBScript:
Microsoft.ClearScript.Windows.VBScriptEngine
.Microsoft.ClearScript.Windows.Core.VBScriptEngine
.The first class doesn't require an external implementation of
ISyncInvoker
. Instead, it provides its own implementation backed by an instance ofDispatcher
. This version ofVBScriptEngine
is intended for desktop or console applications that have a main thread (or one or more UI threads)…