Version 2 DOES NOT USE WEB.CONFIG for configuration anymore
So start by deleting it and reading the rest of this link
https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/How-to-upgrade-applications-to-version-2.X
Basically you will do the following:
- Removing existing web.config nodes for javscript engine
- Adding to another place, for example global.asax, the initialization code
- Install Nuget Packages for the Engines You Want to Use
- Be sure to add a
using statement to be able to use extension methods (if you choose this path)
I got something like this:
using JavaScriptEngineSwitcher.Core; using JavaScriptEngineSwitcher.Msie; using JavaScriptEngineSwitcher.V8; .... public class JsEngineSwitcherConfig { public static void Configure(JsEngineSwitcher engineSwitcher) { engineSwitcher.EngineFactories .AddMsie(new MsieSettings { UseEcmaScript5Polyfill = true, UseJson2Library = true }) .AddV8(); engineSwitcher.DefaultEngineName = MsieJsEngine.EngineName; } }
source share