-
Notifications
You must be signed in to change notification settings - Fork 49
MSIE
JavaScriptEngineSwitcher.Msie contains a MsieJsEngine
adapter (wrapper for the MSIE JavaScript Engine for .NET).
For correct working of the MSIE JavaScript Engine it is recommended to install Internet Explorer 9+ or Microsoft Edge Legacy on the machine.
You can specify a settings of JS engine during its registration:
engineSwitcher.EngineFactories
.AddMsie(new MsieSettings
{
EngineMode = JsEngineMode.ChakraIeJsRt
})
;
If you manually create an instance of JS engine, then you can pass settings via the constructor:
IJsEngine engine = new MsieJsEngine(
new MsieSettings
{
EngineMode = JsEngineMode.ChakraIeJsRt
}
);
Consider in detail properties of the MsieSettings
class:
Property name | Data type | Default value | Description |
---|---|---|---|
AllowReflection |
Boolean |
false |
Flag for whether to allow the usage of reflection API in the script code. This affects |
EnableDebugging |
Boolean |
false |
Flag for whether to allow debugging in Visual Studio by adding the debugger statement to script code. |
EngineMode |
JsEngineMode enumeration |
Auto |
JS engine mode. Can take the following values:
|
MaxStackSize |
Int32 |
503 808 or 1 007 616
|
Maximum stack size in bytes. Set a Not supported in version for .NET Core 1.X. |
UseEcmaScript5Polyfill |
Boolean |
false |
Flag for whether to use the ECMAScript 5 Polyfill. |
UseJson2Library |
Boolean |
false |
Flag for whether to use the JSON2 library |
MSIE JavaScript Engine for .NET has support of the debugging in Visual Studio 2010-2012.
In addition, debuggable script must contain a debugger
statement (see MSDN for more details).
Here are steps, that you need to do for start of debugging:
-
Switch the solution in debug mode.
-
Set the
EnableDebugging
property of theMsieSettings
class totrue
. -
Add the
debugger
statements in debuggable script code. -
Click on the Start button.
-
In opened the Visual Studio Just-In-Time Debugger window select the New instance of Microsoft Visual Studio 2012 item:
-
In the Visual Studio debugger window open the script block(s) and set breakpoint(s):
-
Return to the main Visual Studio window and click on the Continue button.
- Registration of JS engines
- Creating instances of JS engines
- JS engines
- Upgrade guides
- Additional reading and resources