-
-
-
+
+
+ DebugEventHandler type
+
+## v3.17.4 - March 30, 2022
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of March 12, 2022
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.2.4 (support of V8 version 10.0.139.8)
+
+## v3.17.3 - March 6, 2022
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.2.3 (support of V8 version 9.9.115.8)
+
+## v3.17.2 - February 7, 2022
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.2.2 (support of V8 version 9.8.177.9)
+
+## v3.17.1 - January 11, 2022
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.2.1 (support of V8 version 9.7.106.18)
+
+## v3.17.0 - December 27, 2021
+ * In JavaScriptEngineSwitcher.Node:
+ * Jering.Javascript.NodeJS was updated to version 6.3.0
+ * Added support of .NET 6
+
+## v3.16.0 - December 9, 2021
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version of November 11, 2021
+ * No longer supports a .NET Core App 2.1
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2037
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1552
+
+## v3.15.0 - November 28, 2021
+ * In JavaScriptEngineSwitcher.Node:
+ * Jering.Javascript.NodeJS was updated to version 6.2.0
+ * Added support of .NET Core App 3.1 and .NET 5.0
+
+## v3.14.0 - November 23, 2021
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2036
+ * In JavaScriptEngineSwitcher.NiL:
+ * NiL.JS was updated to version 2.5.1541
+ * No longer supports a .NET Framework 4.0 Client and .NET Framework 4.5
+ * Added support of .NET Framework 4.8 and .NET 6.0
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.2.0 (support of V8 version 9.6.180.14)
+
+## v3.13.3 - October 21, 2021
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.1.7 (support of V8 version 9.5.172.21)
+
+## v3.13.2 - October 6, 2021
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 3.0.0 Beta 2035
+ * In configuration settings of the Jint JS engine was added one new property - `MaxArraySize` (default `uint.MaxValue`)
+ * In JavaScriptEngineSwitcher.V8 implemented a handling of error “Internal error. Icu error”
+
+## v3.13.1 - September 22, 2021
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2034
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.1.6 (support of V8 version 9.4.146.16)
+
+## v3.13.0 - August 19, 2021
+ * In JavaScriptEngineSwitcher.Jurassic:
+ * Jurassic was updated to version of August 18, 2021
+ * Debugging is no longer supported
+
+## v3.12.6 - August 10, 2021
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Improved a implementation of the `Dispose` method
+ * MSBuild and PowerShell scripts for installing the native assemblies are made more simple and universal
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.8
+
+## v3.12.5 - July 23, 2021
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2033
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.1.5 (support of V8 version 9.2.230.21)
+ * In configuration settings of the V8 JS engine was added one new property - `MaxArrayBufferAllocation` (default `UInt64.MaxValue`)
+
+## v3.12.4 - June 29, 2021
+ * In JavaScriptEngineSwitcher.NiL:
+ * NiL.JS was updated to version 2.5.1514
+ * Added support of .NET Core App 3.1
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.1.4 (support of V8 version 9.1.269.36)
+ * Added support of OS X (ARM64)
+
+## v3.12.3 - May 26, 2021
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.1.3 (support of V8 version 9.1.269.28)
+
+## v3.12.2 - May 20, 2021
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2032
+
+## v3.12.1 - April 18, 2021
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1493
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.1.2 (support of V8 version 9.0.257.19)
+
+## v3.12.0 - March 28, 2021
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of March 19, 2021
+
+## v3.11.4 - March 19, 2021
+ * In JavaScriptEngineSwitcher.NiL:
+ * NiL.JS was updated to version 2.5.1486
+ * Added support of .NET 5.0
+
+## v3.11.3 - March 9, 2021
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 2031
+
+## v3.11.2 - March 5, 2021
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1475
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.1.1 (support of V8 version 8.9.255.20)
+ * Added support of .NET Standard 2.1
+ * Added support of Linux (ARM)
+ * In configuration settings of the V8 JS engine was added one new property - `HeapExpansionMultiplier` (default `0`)
+
+## v3.11.1 - February 1, 2021
+ * In JavaScriptEngineSwitcher.Jint:
+ * Runtime exceptions now contain a stack trace
+ * In configuration settings of the Jint JS engine a `AllowDebuggerStatement` property has been returned so as not to break compatibility with previous versions
+
+## v3.11.0 - January 30, 2021
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 3.0.0 Beta 2002
+ * In configuration settings of the Jint JS engine a `AllowDebuggerStatement` property has been replaced by the `DebuggerStatementHandlingMode` property (default `Ignore`) and was added two new properties: `DebuggerBreakCallback` (default `null`) and `DebuggerStepCallback` (default `null`)
+
+## v3.10.0 - January 22, 2021
+ * In JavaScriptEngineSwitcher.Node added support of Jering.Javascript.NodeJS version 5.4.4
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.1 (support of V8 version 8.8.278.14)
+ * Added support of Windows (ARM64) and Linux (ARM64)
+
+## v3.9.1 - December 9, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.24 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+
+## v3.9.0 - November 19, 2020
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.0 (support of V8 version 8.7.220.25)
+ * Added support of .NET Framework 4.7.1 and .NET 5.0
+ * Added support of Linux (x64) and OS X (x64)
+ * Own versions of the ClearScript's assemblies are no longer build, because the [official NuGet package](https://www.nuget.org/packages/Microsoft.ClearScript.V8) is now used. Therefore, you should also replace in your projects the `JavaScriptEngineSwitcher.V8.Native.*` packages by the `Microsoft.ClearScript.V8.Native.*` packages.
+
+## v3.8.5 - November 11, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.23 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+
+## v3.8.4 - November 7, 2020
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 1914
+
+## v3.9.0 Preview 3 - November 6, 2020
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.0 RC5 (support of V8 version 8.7.220.16)
+ * Own versions of the ClearScript's assemblies are no longer build, because the [official NuGet package](https://www.nuget.org/packages/Microsoft.ClearScript.V8) is now used. Therefore, you should also replace in your projects the `JavaScriptEngineSwitcher.V8.Native.*` packages by the `Microsoft.ClearScript.V8.Native.*` packages.
+
+## v3.9.0 Preview 2 - October 30, 2020
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.0 RC4 (support of V8 version 8.7.220.10)
+
+## v3.8.3 - October 29, 2020
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.0 RC4 (support of V8 version 8.7.220.10)
+
+## v3.9.0 Preview - October 24, 2020
+ * In JavaScriptEngineSwitcher.V8:
+ * Cross-platform is implemented by using an [unofficial experimental version of the Microsoft ClearScript.V8](https://github.com/Taritsyn/ClearScript-Experimental) library, which is not targeted at any particular operating system or processor architecture, and can work with various native assemblies
+ * Added a packages, that contains a native assemblies for Linux (x64) and OS X (x64)
+
+## v3.8.2 - October 23, 2020
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.0 RC3
+
+## v3.8.1 - October 21, 2020
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 7.0 RC2
+
+## v3.8.0 - October 19, 2020
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 7.0 RC (support of V8 version 8.6.395.17)
+ * MSVC runtime was embedded into the native assemblies for Windows
+
+## v3.7.2 - September 9, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.22 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+ * Added a experimental support of Windows (ARM64)
+ * In JavaScriptEngineSwitcher.Node added support of Jering.Javascript.NodeJS version 5.4.3
+
+## v3.7.1 - August 12, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.21 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+
+## v3.7.0 - August 6, 2020
+ * In JavaScriptEngineSwitcher.Jurassic:
+ * Jurassic was updated to version of August 3, 2020
+ * In configuration settings of the Jurassic JS engine was added one new non-standard property - `EnableHostCollectionsEmbeddingByValue` (default `false`)
+
+## v3.6.0 - August 1, 2020
+ * In JavaScriptEngineSwitcher.Jint added a ability to interrupt execution of the script
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1466
+ * In JavaScriptEngineSwitcher.Node added support of Jering.Javascript.NodeJS version 5.4.2
+
+## v3.5.6 - June 11, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.20 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 1828
+
+## v3.5.5 - May 29, 2020
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 6.0.2 (support of V8 version 8.3.110.9)
+
+## v3.5.4 - May 13, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.19 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+
+## v3.5.3 - May 8, 2020
+ * In JavaScriptEngineSwitcher.V8 fixed a error that caused incorrect generation of error description for an `JsEngineLoadException` exception
+
+## v3.5.2 - April 15, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.18 ([Tomáš Deml's patch](https://github.com/microsoft/ChakraCore/issues/5973) applied)
+
+## v3.5.1 - April 14, 2020
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 1778
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 6.0.1 (support of V8 version 8.1.307.28)
+
+## v3.5.0 - April 3, 2020
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 3.0.0 Beta 1756
+ * No longer supports a .NET Framework 4.5
+ * Added support of .NET Framework 4.6.1 and .NET Standard 2.1
+
+## v3.4.5 - April 1, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore applied the Tomáš Deml's patch to fix the [“Incompatibility in handling of SIGSEGV between ChakraCore and CoreCLR”](https://github.com/microsoft/ChakraCore/issues/5973) error
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1440
+ * In JavaScriptEngineSwitcher.Node added a handling of errors that occur when switching to multi-process mode of the Jering.Javascript.NodeJS library
+
+## v3.4.4 - March 11, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.17
+ * In JavaScriptEngineSwitcher.Node added support of Jering.Javascript.NodeJS version 5.4.0
+
+## v3.4.3 - March 8, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a [error #82](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/82) “Program crash after function call with too much parameters”
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1431
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.7
+
+## v3.4.2 - March 2, 2020
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 3.0.0 Beta 1715
+ * Simplified and improved a handling of JS runtime errors
+
+## v3.4.1 - February 26, 2020
+ * In JavaScriptEngineSwitcher.Node the default Node JS service is now implemented as a wrapper around the StaticNodeJSService class
+
+## v3.4.0 - February 24, 2020
+ * Added a module based on the [Jering.Javascript.NodeJS](https://github.com/JeringTech/Javascript.NodeJS)
+
+## v3.3.3 - February 15, 2020
+ * In JavaScriptEngineSwitcher.NiL:
+ * NiL.JS was updated to version 2.5.1428
+ * NiL.JS.NetCore package is no longer used
+ * Added support of .NET Framework 4.6.1 and .NET Standard 1.6
+
+## v3.3.2 - February 14, 2020
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.16
+
+## v3.3.1 - February 1, 2020
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1403
+ * Added a `ClearScript.xml` files to the JavaScriptEngineSwitcher.V8 package
+
+## v3.3.0 - December 27, 2019
+ * Enabled a SourceLink in NuGet packages
+ * In JavaScriptEngineSwitcher.ChakraCore added support of .NET Standard 2.1
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 6.0.0 (support of V8 version 7.9.317.32)
+ * Added support of .NET Core 3.1 on Windows
+ * Now the Microsoft ClearScript.V8 requires the [Microsoft Visual C++ Redistributable for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2019)
+
+## v3.2.4 - December 17, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a errors leading to null reference exceptions in the `ReflectionHelpers` class. Special thanks to [Vanjoge](https://github.com/vanjoge).
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.6
+
+## v3.2.3 - November 15, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.15
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 1632
+ * In JavaScriptEngineSwitcher.NiL:
+ * NiL.JS was updated to version 2.5.1388
+ * In configuration settings of the NiL JS engine was added one new property - `LocalTimeZone` (default `TimeZoneInfo.Local`)
+
+## v3.2.2 - October 26, 2019
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 3.0.0 Beta 1629
+
+## v3.2.1 - October 21, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Fixed a error that caused a crash during finalization
+ * During calling of the `CollectGarbage` method is again not performed blocking
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.5
+
+## v3.2.0 - October 12, 2019
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 3.0.0 Beta 1612. Special thanks to [Marko Lahma](https://github.com/lahma) and [Sébastien Ros](https://github.com/sebastienros)
+ * No longer supports a .NET Framework 4.0 Client and .NET Standard 1.3
+ * In configuration settings of the Jint JS engine was added two new properties: `MemoryLimit` (default `0`) and `RegexTimeoutInterval` (default `null`)
+ * To install this package, the “Include Prerelease” option must be set in the NuGet Package Manager
+
+## v3.1.10 - October 9, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.14
+ * Slightly improved performance
+ * The `CollectGarbage` method is called synchronously again
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.4
+
+## v3.1.9 - September 17, 2019
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1372
+
+## v3.1.8 - September 12, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.13
+
+## v3.1.7 - August 14, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.12
+ * MSVC runtime was embedded into the native assemblies for Windows
+
+## v3.1.6 - August 5, 2019
+ * In JavaScriptEngineSwitcher.V8 fixed a [error #73](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/73) “Trying to Run this in the GAC”
+
+## v3.1.5 - August 2, 2019
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.6.0 (support of V8 version 7.6.303.28)
+
+## v3.1.4 - July 17, 2019
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1339
+
+## v3.1.3 - July 10, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.11
+
+## v3.1.2 - June 13, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.10
+
+## v3.1.1 - May 15, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.9
+
+## v3.1.0 - May 3, 2019
+ * In the `JsEngineFactoryCollection` class was added a `Count` property and `GetRegisteredFactories` method
+ * Removed a deprecated packages: JavaScriptEngineSwitcher.ChakraCore.Native.win8-arm and JavaScriptEngineSwitcher.ChakraCore.Native.debian-x64
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.5.6 (support of V8 version 7.4.288.26)
+
+## v3.0.10 - April 29, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore in configuration settings was changed default value of `DisableFatalOnOOM` property from `false` to `true`
+ * In JavaScriptEngineSwitcher.Jint fixed a error that occurred during the recursive execution and evaluation of JS files
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.3
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1327
+
+## v3.0.9 - April 10, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.8
+
+## v3.0.8 - April 9, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a [error #72](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/72) “(chakra) recursive evaluation”
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1320
+
+## v3.0.7 - March 13, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.7
+ * Fixed a [error #68](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/68) “Embedded delegates are no longer linked with the `Function` prototype”
+ * In JavaScriptEngineSwitcher.Jint fixed a error that occurs in the strict mode when generating an error message
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.2
+
+## v3.0.6 - February 15, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.6
+
+## v3.0.5 - February 8, 2019
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.5.5 (support of V8 version 7.2.502.25)
+
+## v3.0.4 - February 1, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore in error message fixed a link to the documentation
+
+## v3.0.3 - January 29, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore improved a performance of the `UnicodeToAnsi` method of `EncodingHelpers` class
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1294
+
+## v3.0.2 - January 24, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Reduced a memory consumption in cases, where not used the embedding of objects and types
+ * Fixed a wrong implementation of destruction of the embedded delegates
+ * Accelerated a conversion of script types to host types
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.1
+
+## v3.0.1 - January 11, 2019
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.5
+ * Fixed a [error #65](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/65) “Memory leak using EmbedHostObject”
+
+## v3.0.0 - December 25, 2018
+ * In the `JsEngineSwitcher` class a `Instance` property was renamed to the `Current` property
+ * Now you can implement your own version of the `JsEngineSwitcher` class
+ * Format of the error messages was unified
+ * Created a new exception classes: `JsCompilationException`, `JsEngineException`, `JsFatalException`, `JsInterruptedException`, `JsTimeoutException`, `JsScriptException` and `JsUsageException`. These exceptions are responsible for handling errors, some of which were previously handled by the `JsRuntimeException` class
+ * In the `JsException` class was added two new properties: `Category` and `Description`
+ * From the `JsRuntimeException` class was removed one property - `ErrorCode`
+ * In the `JsRuntimeException` class was added three new properties: `Type`, `DocumentName` and `CallStack`
+ * `JsEngineLoadException` class now is inherited from the `JsEngineException` class
+ * Removed a `EmptyValueException` class
+ * `Format` method of the `JsErrorHelpers` class was renamed to the `GenerateErrorDetails`
+ * Part of the auxiliary code was moved to external libraries: [PolyfillsForOldDotNet](https://github.com/Taritsyn/PolyfillsForOldDotNet) and [AdvancedStringBuilder](https://github.com/Taritsyn/AdvancedStringBuilder)
+ * In `IJsEngine` interface was added two new properties: `SupportsScriptInterruption` and `SupportsScriptPrecompilation`, and four new methods: `Interrupt`, `Precompile`, `PrecompileFile` and `PrecompileResource`
+ * In JavaScriptEngineSwitcher.Extensions.MsDependencyInjection added a overloaded versions of the `AddJsEngineSwitcher` extension method, which takes an instance of JS engine switcher
+ * In JavaScriptEngineSwitcher.ChakraCore, JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8 and JavaScriptEngineSwitcher.Vroom added a ability to interrupt execution of the script
+ * In JavaScriptEngineSwitcher.ChakraCore, JavaScriptEngineSwitcher.Jint, JavaScriptEngineSwitcher.Jurassic, JavaScriptEngineSwitcher.Msie and JavaScriptEngineSwitcher.V8 added a ability to pre-compile scripts
+ * In all modules, except the JavaScriptEngineSwitcher.V8, added support of .NET Standard 2.0
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.4
+ * No longer used the old ChakraCore API for Windows (Internet Explorer-like API)
+ * Now the ChakraCore for Windows requires the [Microsoft Visual C++ Redistributable for Visual Studio 2017](https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017)
+ * In configuration settings of the ChakraCore JS engine was added one new property - `MaxStackSize` (default `492` or `984` KB)
+ * Added support of .NET Framework 4.7.1 and .NET Core App 2.1
+ * In JavaScriptEngineSwitcher.Jint:
+ * Jint was updated to version 2.11.58
+ * In configuration settings of the Jint JS engine a `Timeout` property has been replaced by the `TimeoutInterval` property (default `TimeSpan.Zero`) and was added one new property - `LocalTimeZone` (default `TimeZoneInfo.Local`)
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of February 24, 2018
+ * In JavaScriptEngineSwitcher.Msie:
+ * MSIE JavaScript Engine was updated to version 3.0.0
+ * In configuration settings of the MSIE JS engine was added one new property - `MaxStackSize` (default `492` or `984` KB)
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 5.5.4 (support of V8 version 7.0.276.42)
+ * Now requires .NET Framework 4.5 or higher
+ * Now the Microsoft ClearScript.V8 requires the [Microsoft Visual C++ Redistributable for Visual Studio 2017](https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017)
+ * In configuration settings of the V8 JS engine became obsolete the `MaxExecutableSize` property and added two new properties: `AwaitDebuggerAndPauseOnStart` (default `false`) and `EnableRemoteDebugging` (default `false`)
+ * In JavaScriptEngineSwitcher.Vroom added support of .NET Framework 4.7.1
+ * Added a module based on the [NiL.JS](https://github.com/nilproject/NiL.JS)
+
+## v3.0.0 RC 3 - December 18, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.4
+ * Improved a performance of script pre-compilation
+
+## v3.0.0 RC 2 - December 4, 2018
+ * `GetSourceFragmentFromCode` and `GetSourceFragmentFromLine` methods of `JsErrorHelpers` class were replaced by the `GetTextFragment` and `GetTextFragmentFromLine` methods of `TextHelpers` class
+ * Part of the auxiliary code was moved to external libraries: [PolyfillsForOldDotNet](https://github.com/Taritsyn/PolyfillsForOldDotNet) and [AdvancedStringBuilder](https://github.com/Taritsyn/AdvancedStringBuilder)
+ * Removed a unnecessary `net471` targets
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 RC 2
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.5.4 (support of V8 version 7.0.276.42)
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.3
+ * In the `NativeMethods` class for the `netstandard` and `netcoreapp` targets was changed a calling convention from `StdCall` to `Cdecl`
+ * Charset was explicitly specified in the `JsCreateString`, `JsCopyString` and `JsCreatePropertyId` methods of `NativeMethods` class
+ * Added a `netcoreapp2.1` target
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1282
+
+## v2.4.29 - November 20, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.10
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.3
+
+## v2.4.28 - October 13, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.2
+
+## v2.4.27 - September 21, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore was optimized a memory usage in version for Unix
+
+## v3.0.0 RC 1 - September 19, 2018
+ * Fixed a [error #59](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/59) “Unhandled exception when JS exception is thrown”
+ * In JavaScriptEngineSwitcher.Msie:
+ * Added support of MSIE JavaScript Engine version 3.0.0 RC 1
+ * In configuration settings of the MSIE JS engine was added one new property - `MaxStackSize` (default `492` or `984` KB)
+ * In JavaScriptEngineSwitcher.Jint in configuration settings was added one new property - `LocalTimeZone` (default `TimeZoneInfo.Local`)
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.11.1
+ * No longer used the old ChakraCore API for Windows (Internet Explorer-like API)
+ * Optimized a memory usage
+ * `MaxStackSize` configuration property was removed from the version for .NET Standard 1.3
+
+## v2.4.26 - September 13, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.1
+
+## v2.4.25 - September 8, 2018
+ * In JavaScriptEngineSwitcher.Jint in configuration settings was added one new property - `LocalTimeZone` (default `TimeZoneInfo.Local`)
+ * In JavaScriptEngineSwitcher.ChakraCore improved a performance in version for Unix
+
+## v2.4.24 - August 30, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.11.0
+
+## v3.0.0 Beta 9 - August 21, 2018
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.5.3 (support of V8 version 6.8.275.28)
+ * In JavaScriptEngineSwitcher.Jurassic the original library was rolled back to version of February 24, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.10.2
+ * In JavaScriptEngineSwitcher.NiL:
+ * Added support of NiL.JS version 2.5.1278
+ * Fixed a [error #57](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/57) “Nil - can't locate function name”
+
+## v2.4.23 - August 20, 2018
+ * In JavaScriptEngineSwitcher.Jurassic the original library was rolled back to version of February 24, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.10.2
+
+## v2.4.22 - July 11, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.10.1
+
+## v3.0.0 Beta 8 - July 7, 2018
+ * ChakraCore was updated to version 1.10.0
+ * In configuration settings of the ChakraCore JS engine was added one new property - `DisableExecutablePageAllocation` (default `false`)
+
+## v2.4.21 - July 2, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.10.0
+ * In configuration settings of the ChakraCore JS engine was added one new property - `DisableExecutablePageAllocation` (default `false`)
+
+## v3.0.0 Beta 7 - June 18, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.8.5
+
+## v2.4.20 - June 13, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.8.5
+
+## v3.0.0 Beta 6 - June 12, 2018
+ * In JavaScriptEngineSwitcher.Extensions.MsDependencyInjection added a overloaded versions of the `AddJsEngineSwitcher` extension method, which takes an instance of JS engine switcher
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of June 7, 2018
+
+## v2.4.19 - June 12, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.9
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of June 7, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore changed a implementation of the `Dispose` method
+
+## v3.0.0 Beta 5 - June 6, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Beta 4
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Changed a implementation of the `Dispose` method
+ * Prevented a early destruction of delegates, which have been passed to the native methods
+ * In JavaScriptEngineSwitcher.NiL added support of NiL.JS version 2.5.1275
+
+## v3.0.0 Beta 4 - May 29, 2018
+ * Fixed a [error #54](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/54) “System.Runtime.InteropServices.RuntimeInformation not required for .NET Framework 4.7.1”. Special thanks to [David Gardiner](https://github.com/flcdrg).
+ * Now all modules are support of .NET Framework 4.7.1
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Beta 3
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Fixed a implementation of the `JsSerializedLoadScriptCallback` delegate
+ * Fixed a [error #34](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/34) “Finalazier thread is blocked because of JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine”
+
+## v2.4.18 - May 24, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.8
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a [error #34](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/34) “Finalazier thread is blocked because of JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine”
+
+## v3.0.0 Beta 3 - May 22, 2018
+ * In `IJsEngine` interface was added `SupportsScriptPrecompilation` property and three new methods: `Precompile`, `PrecompileFile` and `PrecompileResource`
+ * In JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8, JavaScriptEngineSwitcher.Jurassic, JavaScriptEngineSwitcher.Jint and JavaScriptEngineSwitcher.ChakraCore added a ability to pre-compile scripts
+ * Added a module based on the NiL.JS
+ * In JavaScriptEngineSwitcher.V8.Native.win-* and JavaScriptEngineSwitcher.ChakraCore.Native.win-* packages the directories with `win7-*` RIDs was renamed to `win-*`
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Beta 2
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.8.4
+ * JavaScriptEngineSwitcher.ChakraCore.Native.win8-arm package has been replaced by the JavaScriptEngineSwitcher.ChakraCore.Native.win-arm package
+
+## v2.4.17 - May 9, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.8.4
+ * JavaScriptEngineSwitcher.ChakraCore.Native.win8-arm package has been replaced by the JavaScriptEngineSwitcher.ChakraCore.Native.win-arm package
+
+## v2.4.16 - April 13, 2018
+ * In JavaScriptEngineSwitcher.V8.Native.win-* and JavaScriptEngineSwitcher.ChakraCore.Native.win-* packages the directories with `win7-*` RIDs was renamed to `win-*`
+
+## v3.0.0 Beta 2 - April 12, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.8.3
+
+## v2.4.15 - April 11, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.7
+ * In JavaScriptEngineSwitcher.ChakraCore and JavaScriptEngineSwitcher.Vroom fixed a minor errors
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.8.3
+
+## v3.0.0 Beta 1 - April 8, 2018
+ * Format of the error messages was unified
+ * Created a new exception classes: `JsCompilationException`, `JsEngineException`, `JsFatalException`, `JsTimeoutException` and `JsUsageException`. These exceptions are responsible for handling errors, some of which were previously handled by the `JsRuntimeException` class.
+ * In the `JsException` class was added two new properties: `Category` and `Description`
+ * From the `JsRuntimeException` class was removed one property - `ErrorCode`
+ * In the `JsRuntimeException` class was added three new properties: `Type`, `DocumentName` and `CallStack`
+ * `JsScriptInterruptedException` class was renamed to the `JsInterruptedException` class and now is inherited from the `JsRuntimeException` class
+ * `JsEngineLoadException` class now is inherited from the `JsEngineException` class
+ * Removed a `EmptyValueException` class
+ * `Format` method of the `JsErrorHelpers` class was renamed to the `GenerateErrorDetails`
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Beta 1
+ * In JavaScriptEngineSwitcher.V8:
+ * Added support of Microsoft ClearScript.V8 version 5.5.2 (support of V8 version 6.5.254.41)
+ * Now the Microsoft ClearScript.V8 requires the [Microsoft Visual C++ Redistributable for Visual Studio 2017](https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017)
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of February 24, 2018
+ * In JavaScriptEngineSwitcher.Jint in configuration settings of the Jint JS engine a `Timeout` property has been replaced by the `TimeoutInterval` property (default `TimeSpan.Zero`)
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.8.2
+ * Now the ChakraCore for Windows requires the [Microsoft Visual C++ Redistributable for Visual Studio 2017](https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017)
+ * In configuration settings of the ChakraCore JS engine was added one new property - `MaxStackSize` (default `492` or `984` KB)
+
+## v2.4.14 - March 14, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.8.2
+
+## v2.4.13 - February 24, 2018
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.6
+ * In JavaScriptEngineSwitcher.V8:
+ * Microsoft ClearScript.V8 was updated to version 5.4.10
+ * Improved implementation of the `CallFunction` method
+ * Removed unnecessary locks from the `V8JsEngine` class
+ * In configuration settings of the V8 JS engine was added 3 new properties: `HeapSizeSampleInterval` (default `TimeSpan.Zero`), `MaxHeapSize` (default `UIntPtr.Zero`) and `MaxStackUsage` (default `UIntPtr.Zero`)
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of February 24, 2018
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 2.11.58
+
+## v2.4.12 - February 20, 2018
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.8.1
+ * JavaScriptEngineSwitcher.ChakraCore.Native.debian-x64 package has been replaced by the JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64 package
+ * ICU-57 library was embedded into the `libChakraCore.so` and `libChakraCore.dylib` assemblies
+ * Prevented an occurrence of the “Host may not have set any promise continuation callback. Promises may not be executed.” error
+ * In configuration settings of the ChakraCore JS engine was added two new properties - `MemoryLimit` and `DisableFatalOnOOM` (default `false`)
+ * Now during calling of the `CollectGarbage` method is no longer performed blocking
+
+## v3.0.0 Alpha 10 - January 3, 2018
+ * In JavaScriptEngineSwitcher.V8:
+ * Added support of Microsoft ClearScript.V8 version 5.5.1.1 (support of V8 version 6.3.292.48)
+ * In configuration settings of the V8 JS engine was added one new property - `AwaitDebuggerAndPauseOnStart` (default `false`)
+
+## v2.4.11 - December 24, 2017
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.5
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a error, that occurred during finding the suitable method overload, that receives numeric values and interfaces as parameters, of the host object
+
+## v3.0.0 Alpha 9 - December 22, 2017
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Alpha 3
+ * In JavaScriptEngineSwitcher.V8 in configuration settings of the V8 JS engine was changed types of `MaxHeapSize` and `MaxStackUsage` properties from `ulong` to `UIntPtr`
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 2.11.58
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.7.5
+ * In configuration settings of the ChakraCore JS engine was added two new properties - `MemoryLimit` and `DisableFatalOnOOM` (default `false`)
+ * Now during calling of the `CollectGarbage` method is no longer performed blocking
+
+## v3.0.0 Alpha 8 - November 17, 2017
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 3.0.0 Alpha 2
+ * In JavaScriptEngineSwitcher.ChakraCore fixed a error, that occurred during finding the suitable method overload, that receives numeric values and interfaces as parameters, of the host object
+
+## v3.0.0 Alpha 7 - November 12, 2017
+ * In JavaScriptEngineSwitcher.V8.Native.win-* and JavaScriptEngineSwitcher.ChakraCore.Native.win* packages fixed a error “When using PackageReference DLL is not copied”
+ * In JavaScriptEngineSwitcher.V8:
+ * Added support of Microsoft ClearScript.V8 version 5.5.0 (support of V8 version 6.2.414.40)
+ * Now requires .NET Framework 4.5 or greater
+ * In configuration settings of the V8 JS engine became obsolete the `MaxExecutableSize` property and was added 4 new properties: `EnableRemoteDebugging` (default `false`), `HeapSizeSampleInterval` (default `TimeSpan.Zero`), `MaxHeapSize` (default `0`) and `MaxStackUsage` (default `0`)
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of November 2, 2017
+
+## v3.0.0 Alpha 6 - October 17, 2017
+ * In all modules, except the JavaScriptEngineSwitcher.V8 module, added support of .NET Standard 2.0
+ * In JavaScriptEngineSwitcher.V8 improved implementation of the `CallFunction` method
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of September 1, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * ChakraCore was updated to version 1.7.3
+ * JavaScriptEngineSwitcher.ChakraCore.Native.debian-x64 package has been replaced by the JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64 package
+ * ICU-57 library was embedded into the `libChakraCore.so` and `libChakraCore.dylib` assemblies
+
+## v3.0.0 Alpha 5 - September 29, 2017
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version 5.4.10
+
+## v3.0.0 Alpha 4 - September 22, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore prevented an occurrence of the “Host may not have set any promise continuation callback. Promises may not be executed.” error
+
+## v3.0.0 Alpha 3 - September 15, 2017
+ * In JavaScriptEngineSwitcher.Msie:
+ * Added support of MSIE JavaScript Engine version 3.0.0 Alpha 1
+ * Added a ability to interrupt execution of the script
+ * In JavaScriptEngineSwitcher.Jint added support of Jint version 2.11.23
+ * In JavaScriptEngineSwitcher.ChakraCore:
+ * Added support of ChakraCore version 1.7.2
+ * Compilation error messages now contains a information about the error location
+
+## v3.0.0 Alpha 2 - July 26, 2017
+ * In `JsEngineSwitcher` class `Instance` property was renamed to the `Current` property
+ * Now you can implement your own version of the `JsEngineSwitcher` class
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of July 13, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.7.0
+
+## v3.0.0 Alpha 1 - July 12, 2017
+ * In `IJsEngine` interface was added `SupportsScriptInterruption` property and `Interrupt` method
+ * In JavaScriptEngineSwitcher.V8 and JavaScriptEngineSwitcher.ChakraCore added a ability to interrupt execution of the script
+
+## v2.4.10 - July 4, 2017
+ * Now during the rethrowing of exceptions are preserved the full call stack trace
+ * In JavaScriptEngineSwitcher.ChakraCore was reduced a number of delegate-wrappers
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.3
+
+## v2.4.9 - June 28, 2017
+ * Added support of identifier names compliant with ECMAScript 5
+ * In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.2.2
+
+## v2.4.8 - June 27, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore an attempt was made to prevent a blocking of finalizer's thread
+
+## v2.4.7 - June 26, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore now the original exception is added to instance of the `JsRuntimeException` class as an inner exception
+
+## v2.4.6 - June 16, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.5.2
+
+## v2.4.5 - June 8, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.5.1
+
+## v2.4.4 - May 31, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore an attempt was made to prevent occurrence of the access violation exception
+
+## v2.4.3 - May 26, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.5.0
+
+## v2.4.2 - May 24, 2017
+ * In JavaScriptEngineSwitcher.V8 added support of Microsoft ClearScript.V8 version of May 13, 2017
+ * In JavaScriptEngineSwitcher.Jurassic added support of Jurassic version of May 24, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.4.4
+
+## v2.4.1 - April 27, 2017
+ * In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.4.3
+
+## v2.4.0 - April 26, 2017
+ * Added support of .NET Core 1.0.4
+ * In `IJsEngine` interface was added overloaded versions of the `Evaluate`, `Evaluate@error.SourceFragment+ } +
`, ``, and ``.
+@font-family-monospace: Consolas, "Courier New", monospace;
+@font-family-base: @font-family-sans-serif;
+
+@font-size-base: 14px;
+@font-size-large: ceil((@font-size-base * 1.25)); // ~18px
+@font-size-small: ceil((@font-size-base * 0.85)); // ~12px
+
+@font-size-h1: floor(@font-size-base * 3);
+@font-size-h2: @font-size-base * 2.5;
+@font-size-h3: ceil(@font-size-base * 1.75);
+@font-size-h4: ceil(@font-size-base * 1.25);
+@font-size-h5: @font-size-base;
+@font-size-h6: ceil(@font-size-base * 0.85);
+
+//** Unit-less `line-height` for use in components like buttons.
+@line-height-base: 1.428571429; // 20/14
+//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
+@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px
+
+//** By default, this inherits from the ``.
+@headings-font-family: "Open Sans", sans-serif;
+@headings-font-weight: normal;
+@headings-line-height: 1.1;
+@headings-color: inherit;
+
+
+//== Iconography
+//
+//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
+
+//** Load fonts from this directory.
+@icon-font-path: "../fonts/";
+//** File name for all font files.
+@icon-font-name: "glyphicons-halflings-regular";
+//** Element ID within SVG icon file.
+@icon-font-svg-id: "glyphicons_halflingsregular";
+
+
+//== Components
+//
+//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
+
+@padding-base-vertical: 4px;
+@padding-base-horizontal: 6px;
+
+@padding-large-vertical: 10px;
+@padding-large-horizontal: 16px;
+
+@padding-small-vertical: 5px;
+@padding-small-horizontal: 10px;
+
+@padding-xs-vertical: 1px;
+@padding-xs-horizontal: 5px;
+
+@line-height-large: 1.33;
+@line-height-small: 1.5;
+
+@border-radius-base: 4px;
+@border-radius-large: 6px;
+@border-radius-small: 3px;
+
+//** Global color for active items (e.g., navs or dropdowns).
+@component-active-color: #fff;
+//** Global background color for active items (e.g., navs or dropdowns).
+@component-active-bg: @brand-primary;
+
+//** Width of the `border` for generating carets that indicator dropdowns.
+@caret-width-base: 4px;
+//** Carets increase slightly in size for larger components.
+@caret-width-large: 5px;
+
+
+//== Tables
+//
+//## Customizes the `.table` component with basic values, each used across all table variations.
+
+//** Padding for ``s and ` `s.
+@table-cell-padding: 8px;
+//** Padding for cells in `.table-condensed`.
+@table-condensed-cell-padding: 5px;
+
+//** Default background color used for all tables.
+@table-bg: transparent;
+//** Background color used for `.table-striped`.
+@table-bg-accent: #f9f9f9;
+//** Background color used for `.table-hover`.
+@table-bg-hover: #f5f5f5;
+@table-bg-active: @table-bg-hover;
+
+//** Border color for table and cell borders.
+@table-border-color: #ddd;
+
+
+//== Buttons
+//
+//## For each of Bootstrap's buttons, define text, background and border color.
+
+@btn-font-weight: normal;
+
+@btn-default-color: #333;
+@btn-default-bg: @gray-lighter;
+@btn-default-border: @gray-lighter;
+
+@btn-primary-color: #fff;
+@btn-primary-bg: @brand-primary;
+@btn-primary-border: darken(@btn-primary-bg, 5%);
+
+@btn-success-color: #fff;
+@btn-success-bg: @brand-success;
+@btn-success-border: darken(@btn-success-bg, 5%);
+
+@btn-info-color: #fff;
+@btn-info-bg: @brand-info;
+@btn-info-border: darken(@btn-info-bg, 5%);
+
+@btn-warning-color: #fff;
+@btn-warning-bg: @brand-warning;
+@btn-warning-border: darken(@btn-warning-bg, 5%);
+
+@btn-danger-color: #fff;
+@btn-danger-bg: @brand-danger;
+@btn-danger-border: darken(@btn-danger-bg, 5%);
+
+@btn-link-disabled-color: @gray-light;
+
+
+//== Forms
+//
+//##
+
+//** `` background color
+@input-bg: #fff;
+//** `` background color
+@input-bg-disabled: @gray-lighter;
+
+//** Text color for ``s
+@input-color: @gray;
+//** `` border color
+@input-border: #b2b2b2;
+
+// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
+//** Default `.form-control` border radius
+@input-border-radius: @border-radius-base;
+//** Large `.form-control` border radius
+@input-border-radius-large: @border-radius-large;
+//** Small `.form-control` border radius
+@input-border-radius-small: @border-radius-small;
+
+//** Border color for inputs on focus
+@input-border-focus: #d4b33a;
+
+//** Placeholder text color
+@input-color-placeholder: #999;
+
+//** Default `.form-control` height
+@input-height-base: (@line-height-computed + (@padding-base-vertical * 2) + 2);
+//** Large `.form-control` height
+@input-height-large: (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
+//** Small `.form-control` height
+@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
+
+@legend-color: @gray-dark;
+@legend-border-color: #e5e5e5;
+
+//** Background color for textual input addons
+@input-group-addon-bg: @gray-lighter;
+//** Border color for textual input addons
+@input-group-addon-border-color: @input-border;
+
+//** Disabled cursor for form controls and buttons.
+@cursor-disabled: not-allowed;
+
+
+//== Dropdowns
+//
+//## Dropdown menu container and contents.
+
+//** Background for the dropdown menu.
+@dropdown-bg: #fff;
+//** Dropdown menu `border-color`.
+@dropdown-border: rgba(0,0,0,.15);
+//** Dropdown menu `border-color` **for IE8**.
+@dropdown-fallback-border: #ccc;
+//** Divider color for between dropdown items.
+@dropdown-divider-bg: #e5e5e5;
+
+//** Dropdown link text color.
+@dropdown-link-color: @gray-dark;
+//** Hover color for dropdown links.
+@dropdown-link-hover-color: darken(@gray-dark, 5%);
+//** Hover background for dropdown links.
+@dropdown-link-hover-bg: #f5f5f5;
+
+//** Active dropdown menu item text color.
+@dropdown-link-active-color: @component-active-color;
+//** Active dropdown menu item background color.
+@dropdown-link-active-bg: @component-active-bg;
+
+//** Disabled dropdown menu item background color.
+@dropdown-link-disabled-color: @gray-light;
+
+//** Text color for headers within dropdown menus.
+@dropdown-header-color: @gray-light;
+
+//** Deprecated `@dropdown-caret-color` as of v3.1.0
+@dropdown-caret-color: #000;
+
+
+//-- Z-index master list
+//
+// Warning: Avoid customizing these values. They're used for a bird's eye view
+// of components dependent on the z-axis and are designed to all work together.
+//
+// Note: These variables are not generated into the Customizer.
+
+@zindex-navbar: 1000;
+@zindex-dropdown: 1000;
+@zindex-popover: 1060;
+@zindex-tooltip: 1070;
+@zindex-navbar-fixed: 1030;
+@zindex-modal: 1040;
+
+
+//== Media queries breakpoints
+//
+//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
+
+// Extra small screen / phone
+//** Deprecated `@screen-xs` as of v3.0.1
+@screen-xs: 480px;
+//** Deprecated `@screen-xs-min` as of v3.2.0
+@screen-xs-min: @screen-xs;
+//** Deprecated `@screen-phone` as of v3.0.1
+@screen-phone: @screen-xs-min;
+
+// Small screen / tablet
+//** Deprecated `@screen-sm` as of v3.0.1
+@screen-sm: 768px;
+@screen-sm-min: @screen-sm;
+//** Deprecated `@screen-tablet` as of v3.0.1
+@screen-tablet: @screen-sm-min;
+
+// Medium screen / desktop
+//** Deprecated `@screen-md` as of v3.0.1
+@screen-md: 992px;
+@screen-md-min: @screen-md;
+//** Deprecated `@screen-desktop` as of v3.0.1
+@screen-desktop: @screen-md-min;
+
+// Large screen / wide desktop
+//** Deprecated `@screen-lg` as of v3.0.1
+@screen-lg: 1200px;
+@screen-lg-min: @screen-lg;
+//** Deprecated `@screen-lg-desktop` as of v3.0.1
+@screen-lg-desktop: @screen-lg-min;
+
+// So media queries don't overlap when required, provide a maximum
+@screen-xs-max: (@screen-sm-min - 1);
+@screen-sm-max: (@screen-md-min - 1);
+@screen-md-max: (@screen-lg-min - 1);
+
+
+//== Grid system
+//
+//## Define your custom responsive grid.
+
+//** Number of columns in the grid.
+@grid-columns: 12;
+//** Padding between columns. Gets divided in half for the left and right.
+@grid-gutter-width: 30px;
+// Navbar collapse
+//** Point at which the navbar becomes uncollapsed.
+@grid-float-breakpoint: @screen-sm-min;
+//** Point at which the navbar begins collapsing.
+@grid-float-breakpoint-max: (@grid-float-breakpoint - 1);
+
+
+//== Container sizes
+//
+//## Define the maximum width of `.container` for different screen sizes.
+
+// Small screen / tablet
+@container-tablet: (720px + @grid-gutter-width);
+//** For `@screen-sm-min` and up.
+@container-sm: @container-tablet;
+
+// Medium screen / desktop
+@container-desktop: (940px + @grid-gutter-width);
+//** For `@screen-md-min` and up.
+@container-md: @container-desktop;
+
+// Large screen / wide desktop
+@container-large-desktop: (1140px + @grid-gutter-width);
+//** For `@screen-lg-min` and up.
+@container-lg: @container-large-desktop;
+
+
+//== Navbar
+//
+//##
+
+// Basics of a navbar
+@navbar-height: 100px;
+@navbar-margin-bottom: 0;
+@navbar-border-radius: @border-radius-base;
+@navbar-padding-horizontal: 0;
+@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
+@navbar-collapse-max-height: 340px;
+
+@navbar-default-color: @gray-base;
+@navbar-default-bg: #f0db4f;
+@navbar-default-border: #f0db4f;
+
+// Navbar links
+@navbar-default-link-color: @navbar-default-color;
+@navbar-default-link-hover-color: @gray-dark;
+@navbar-default-link-hover-bg: transparent;
+@navbar-default-link-active-color: @navbar-default-color;
+@navbar-default-link-active-bg: transparent;
+@navbar-default-link-disabled-color: #ccc;
+@navbar-default-link-disabled-bg: transparent;
+
+// Navbar brand label
+@navbar-default-brand-color: @navbar-default-link-color;
+@navbar-default-brand-hover-color: darken(@navbar-default-brand-color, 10%);
+@navbar-default-brand-hover-bg: transparent;
+
+// Navbar toggle
+@navbar-default-toggle-hover-bg: #ddd;
+@navbar-default-toggle-icon-bar-bg: @gray-dark;
+@navbar-default-toggle-border-color: #ddd;
+
+
+// Inverted navbar
+// Reset inverted navbar basics
+@navbar-inverse-color: lighten(@gray-light, 15%);
+@navbar-inverse-bg: #222;
+@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
+
+// Inverted navbar links
+@navbar-inverse-link-color: lighten(@gray-light, 15%);
+@navbar-inverse-link-hover-color: #fff;
+@navbar-inverse-link-hover-bg: transparent;
+@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color;
+@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%);
+@navbar-inverse-link-disabled-color: #444;
+@navbar-inverse-link-disabled-bg: transparent;
+
+// Inverted navbar brand label
+@navbar-inverse-brand-color: @navbar-inverse-link-color;
+@navbar-inverse-brand-hover-color: #fff;
+@navbar-inverse-brand-hover-bg: transparent;
+
+// Inverted navbar toggle
+@navbar-inverse-toggle-hover-bg: #333;
+@navbar-inverse-toggle-icon-bar-bg: #fff;
+@navbar-inverse-toggle-border-color: #333;
+
+
+//== Navs
+//
+//##
+
+//=== Shared nav styles
+@nav-link-padding: 10px 15px;
+@nav-link-hover-bg: @gray-lighter;
+
+@nav-disabled-link-color: @gray-light;
+@nav-disabled-link-hover-color: @gray-light;
+
+//== Tabs
+@nav-tabs-border-color: #ddd;
+
+@nav-tabs-link-hover-border-color: @gray-lighter;
+
+@nav-tabs-active-link-hover-bg: @body-bg;
+@nav-tabs-active-link-hover-color: @gray;
+@nav-tabs-active-link-hover-border-color: #ddd;
+
+@nav-tabs-justified-link-border-color: #ddd;
+@nav-tabs-justified-active-link-border-color: @body-bg;
+
+//== Pills
+@nav-pills-border-radius: @border-radius-base;
+@nav-pills-active-link-hover-bg: @component-active-bg;
+@nav-pills-active-link-hover-color: @component-active-color;
+
+
+//== Pagination
+//
+//##
+
+@pagination-color: @link-color;
+@pagination-bg: #fff;
+@pagination-border: #ddd;
+
+@pagination-hover-color: @link-hover-color;
+@pagination-hover-bg: @gray-lighter;
+@pagination-hover-border: #ddd;
+
+@pagination-active-color: #fff;
+@pagination-active-bg: @brand-primary;
+@pagination-active-border: @brand-primary;
+
+@pagination-disabled-color: @gray-light;
+@pagination-disabled-bg: #fff;
+@pagination-disabled-border: #ddd;
+
+
+//== Pager
+//
+//##
+
+@pager-bg: @pagination-bg;
+@pager-border: @pagination-border;
+@pager-border-radius: 15px;
+
+@pager-hover-bg: @pagination-hover-bg;
+
+@pager-active-bg: @pagination-active-bg;
+@pager-active-color: @pagination-active-color;
+
+@pager-disabled-color: @pagination-disabled-color;
+
+
+//== Jumbotron
+//
+//##
+
+@jumbotron-padding: 30px;
+@jumbotron-color: inherit;
+@jumbotron-bg: @gray-lighter;
+@jumbotron-heading-color: inherit;
+@jumbotron-font-size: ceil((@font-size-base * 1.5));
+
+
+//== Form states and alerts
+//
+//## Define colors for form feedback states and, by default, alerts.
+
+@state-success-text: #3c763d;
+@state-success-bg: #dff0d8;
+@state-success-border: darken(spin(@state-success-bg, -10), 5%);
+
+@state-info-text: #31708f;
+@state-info-bg: #d9edf7;
+@state-info-border: darken(spin(@state-info-bg, -10), 7%);
+
+@state-warning-text: #8a6d3b;
+@state-warning-bg: #fcf8e3;
+@state-warning-border: darken(spin(@state-warning-bg, -10), 5%);
+
+@state-danger-text: #a94442;
+@state-danger-bg: #f2dede;
+@state-danger-border: darken(spin(@state-danger-bg, -10), 5%);
+
+
+//== Tooltips
+//
+//##
+
+//** Tooltip max width
+@tooltip-max-width: 200px;
+//** Tooltip text color
+@tooltip-color: #fff;
+//** Tooltip background color
+@tooltip-bg: #000;
+@tooltip-opacity: .9;
+
+//** Tooltip arrow width
+@tooltip-arrow-width: 5px;
+//** Tooltip arrow color
+@tooltip-arrow-color: @tooltip-bg;
+
+
+//== Popovers
+//
+//##
+
+//** Popover body background color
+@popover-bg: #fff;
+//** Popover maximum width
+@popover-max-width: 276px;
+//** Popover border color
+@popover-border-color: rgba(0,0,0,.2);
+//** Popover fallback border color
+@popover-fallback-border-color: #ccc;
+
+//** Popover title background color
+@popover-title-bg: darken(@popover-bg, 3%);
+
+//** Popover arrow width
+@popover-arrow-width: 10px;
+//** Popover arrow color
+@popover-arrow-color: @popover-bg;
+
+//** Popover outer arrow width
+@popover-arrow-outer-width: (@popover-arrow-width + 1);
+//** Popover outer arrow color
+@popover-arrow-outer-color: fadein(@popover-border-color, 5%);
+//** Popover outer arrow fallback color
+@popover-arrow-outer-fallback-color: darken(@popover-fallback-border-color, 20%);
+
+
+//== Labels
+//
+//##
+
+//** Default label background color
+@label-default-bg: @gray-light;
+//** Primary label background color
+@label-primary-bg: @brand-primary;
+//** Success label background color
+@label-success-bg: @brand-success;
+//** Info label background color
+@label-info-bg: @brand-info;
+//** Warning label background color
+@label-warning-bg: @brand-warning;
+//** Danger label background color
+@label-danger-bg: @brand-danger;
+
+//** Default label text color
+@label-color: #fff;
+//** Default text color of a linked label
+@label-link-hover-color: #fff;
+
+
+//== Modals
+//
+//##
+
+//** Padding applied to the modal body
+@modal-inner-padding: 15px;
+
+//** Padding applied to the modal title
+@modal-title-padding: 15px;
+//** Modal title line-height
+@modal-title-line-height: @line-height-base;
+
+//** Background color of modal content area
+@modal-content-bg: #fff;
+//** Modal content border color
+@modal-content-border-color: rgba(0,0,0,.2);
+//** Modal content border color **for IE8**
+@modal-content-fallback-border-color: #999;
+
+//** Modal backdrop background color
+@modal-backdrop-bg: #000;
+//** Modal backdrop opacity
+@modal-backdrop-opacity: .5;
+//** Modal header border color
+@modal-header-border-color: #e5e5e5;
+//** Modal footer border color
+@modal-footer-border-color: @modal-header-border-color;
+
+@modal-lg: 900px;
+@modal-md: 600px;
+@modal-sm: 300px;
+
+
+//== Alerts
+//
+//## Define alert colors, border radius, and padding.
+
+@alert-padding: 15px;
+@alert-border-radius: @border-radius-base;
+@alert-link-font-weight: bold;
+
+@alert-success-bg: @state-success-bg;
+@alert-success-text: @state-success-text;
+@alert-success-border: @state-success-border;
+
+@alert-info-bg: @state-info-bg;
+@alert-info-text: @state-info-text;
+@alert-info-border: @state-info-border;
+
+@alert-warning-bg: @state-warning-bg;
+@alert-warning-text: @state-warning-text;
+@alert-warning-border: @state-warning-border;
+
+@alert-danger-bg: @state-danger-bg;
+@alert-danger-text: @state-danger-text;
+@alert-danger-border: @state-danger-border;
+
+
+//== Progress bars
+//
+//##
+
+//** Background color of the whole progress component
+@progress-bg: #f5f5f5;
+//** Progress bar text color
+@progress-bar-color: #fff;
+//** Variable for setting rounded corners on progress bar.
+@progress-border-radius: @border-radius-base;
+
+//** Default progress bar color
+@progress-bar-bg: @brand-primary;
+//** Success progress bar color
+@progress-bar-success-bg: @brand-success;
+//** Warning progress bar color
+@progress-bar-warning-bg: @brand-warning;
+//** Danger progress bar color
+@progress-bar-danger-bg: @brand-danger;
+//** Info progress bar color
+@progress-bar-info-bg: @brand-info;
+
+
+//== List group
+//
+//##
+
+//** Background color on `.list-group-item`
+@list-group-bg: #fff;
+//** `.list-group-item` border color
+@list-group-border: #ddd;
+//** List group border radius
+@list-group-border-radius: @border-radius-base;
+
+//** Background color of single list items on hover
+@list-group-hover-bg: #f5f5f5;
+//** Text color of active list items
+@list-group-active-color: @component-active-color;
+//** Background color of active list items
+@list-group-active-bg: @component-active-bg;
+//** Border color of active list elements
+@list-group-active-border: @list-group-active-bg;
+//** Text color for content within active list items
+@list-group-active-text-color: lighten(@list-group-active-bg, 40%);
+
+//** Text color of disabled list items
+@list-group-disabled-color: @gray-light;
+//** Background color of disabled list items
+@list-group-disabled-bg: @gray-lighter;
+//** Text color for content within disabled list items
+@list-group-disabled-text-color: @list-group-disabled-color;
+
+@list-group-link-color: #555;
+@list-group-link-hover-color: @list-group-link-color;
+@list-group-link-heading-color: #333;
+
+
+//== Panels
+//
+//##
+
+@panel-bg: #fff;
+@panel-body-padding: 15px;
+@panel-heading-padding: 10px 15px;
+@panel-footer-padding: @panel-heading-padding;
+@panel-border-radius: @border-radius-base;
+
+//** Border color for elements within panels
+@panel-inner-border: #ddd;
+@panel-footer-bg: #f5f5f5;
+
+@panel-default-text: @gray-dark;
+@panel-default-border: #ddd;
+@panel-default-heading-bg: #f5f5f5;
+
+@panel-primary-text: #fff;
+@panel-primary-border: @brand-primary;
+@panel-primary-heading-bg: @brand-primary;
+
+@panel-success-text: @state-success-text;
+@panel-success-border: @state-success-border;
+@panel-success-heading-bg: @state-success-bg;
+
+@panel-info-text: @state-info-text;
+@panel-info-border: @state-info-border;
+@panel-info-heading-bg: @state-info-bg;
+
+@panel-warning-text: @state-warning-text;
+@panel-warning-border: @state-warning-border;
+@panel-warning-heading-bg: @state-warning-bg;
+
+@panel-danger-text: @state-danger-text;
+@panel-danger-border: @state-danger-border;
+@panel-danger-heading-bg: @state-danger-bg;
+
+
+//== Thumbnails
+//
+//##
+
+//** Padding around the thumbnail image
+@thumbnail-padding: 4px;
+//** Thumbnail background color
+@thumbnail-bg: @body-bg;
+//** Thumbnail border color
+@thumbnail-border: #ddd;
+//** Thumbnail border radius
+@thumbnail-border-radius: @border-radius-base;
+
+//** Custom text color for thumbnail captions
+@thumbnail-caption-color: @text-color;
+//** Padding around the thumbnail caption
+@thumbnail-caption-padding: 9px;
+
+
+//== Wells
+//
+//##
+
+@well-bg: #f5f5f5;
+@well-border: darken(@well-bg, 7%);
+
+
+//== Badges
+//
+//##
+
+@badge-color: #fff;
+//** Linked badge text color on hover
+@badge-link-hover-color: #fff;
+@badge-bg: @gray-light;
+
+//** Badge text color in active nav link
+@badge-active-color: @link-color;
+//** Badge background color in active nav link
+@badge-active-bg: #fff;
+
+@badge-font-weight: bold;
+@badge-line-height: 1;
+@badge-border-radius: 10px;
+
+
+//== Breadcrumbs
+//
+//##
+
+@breadcrumb-padding-vertical: 8px;
+@breadcrumb-padding-horizontal: 15px;
+//** Breadcrumb background color
+@breadcrumb-bg: #f5f5f5;
+//** Breadcrumb text color
+@breadcrumb-color: #ccc;
+//** Text color of current page in the breadcrumb
+@breadcrumb-active-color: @gray-light;
+//** Textual separator for between breadcrumb elements
+@breadcrumb-separator: "/";
+
+
+//== Carousel
+//
+//##
+
+@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
+
+@carousel-control-color: #fff;
+@carousel-control-width: 15%;
+@carousel-control-opacity: .5;
+@carousel-control-font-size: 20px;
+
+@carousel-indicator-active-bg: #fff;
+@carousel-indicator-border-color: #fff;
+
+@carousel-caption-color: #fff;
+
+
+//== Close
+//
+//##
+
+@close-font-weight: bold;
+@close-color: #000;
+@close-text-shadow: 0 1px 0 #fff;
+
+
+//== Code
+//
+//##
+
+@code-color: #c7254e;
+@code-bg: #f9f2f4;
+
+@kbd-color: #fff;
+@kbd-bg: #333;
+
+@pre-bg: #f5f5f5;
+@pre-color: @gray-dark;
+@pre-border-color: #ccc;
+@pre-scrollable-max-height: 340px;
+
+
+//== Type
+//
+//##
+
+//** Horizontal offset for forms and lists.
+@component-offset-horizontal: 180px;
+//** Text muted color
+@text-muted: @gray-light;
+//** Abbreviations and acronyms border color
+@abbr-border-color: @gray-light;
+//** Headings small color
+@headings-small-color: @gray-light;
+//** Blockquote small color
+@blockquote-small-color: @gray-light;
+//** Blockquote font size
+@blockquote-font-size: (@font-size-base * 1.25);
+//** Blockquote border color
+@blockquote-border-color: @gray-lighter;
+//** Page header border color
+@page-header-border-color: @gray-lighter;
+//** Width of horizontal description list titles
+@dl-horizontal-offset: @component-offset-horizontal;
+//** Horizontal line color.
+@hr-border: #b2b2b2;
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/buttons.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/buttons.less
new file mode 100644
index 00000000..bbb3c620
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/buttons.less
@@ -0,0 +1,61 @@
+//
+// Buttons
+// --------------------------------------------------
+
+
+// Base styles
+// --------------------------------------------------
+
+// Core styles
+.btn {
+ display: inline-block;
+ padding: 5px 6px 4px 8px;
+ margin-top: 0;
+ margin-bottom: 0; // For input.btn
+ font-family: "Open Sans Condensed", sans-serif;
+ font-size: @font-size-base * 1.3;
+ font-weight: 700;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ line-height: @line-height-computed;
+ text-align: center;
+ vertical-align: middle;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-color: @gray-lighter;
+ background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
+ border: none;
+ border-radius: 3px;
+ .box-shadow(1px 1px 0 rgba(0, 0, 0, 0.3));
+ outline: none !important;
+ white-space: nowrap;
+ .user-select(none);
+
+ &:focus,
+ &.focus {
+ .tab-focus();
+ }
+
+ &:hover,
+ &:focus,
+ &.focus {
+ background-color: lighten(@gray-lighter, 5%);
+ text-decoration: none;
+ .transition(background-color .1s linear);
+ }
+
+ &:active,
+ &.active {
+ outline: 0;
+ padding: 6px 5px 3px 9px;
+ }
+
+ &.disabled,
+ &[disabled],
+ fieldset[disabled] & {
+ cursor: @cursor-disabled;
+ pointer-events: none; // Future-proof disabling of clicks
+ .opacity(65);
+ .box-shadow(1px 1px 0 rgba(0, 0, 0, 0.15));
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/code.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/code.less
new file mode 100644
index 00000000..33af7555
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/code.less
@@ -0,0 +1,8 @@
+code {
+ margin: 0 2px;
+ padding: 1px 5px;
+ border: 1px solid #E1E1E8;
+ background-color: #F7F7F9;
+ color: @gray-dark;
+ font-size: 85%;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/evaluation-form.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/evaluation-form.less
new file mode 100644
index 00000000..6d505d56
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/evaluation-form.less
@@ -0,0 +1,91 @@
+//
+// Evaluation form
+// --------------------------------------------------
+
+
+.evaluation-form {
+ .clearfix();
+
+ textarea {
+ height: 200px;
+ }
+}
+
+.evaluation-input-output {
+ float: left;
+ width: 65%;
+}
+
+.evaluation-input-clear-button {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 15px;
+ height: 15px;
+ margin: 6px;
+ display: inline-block;
+ background: transparent url("../images/clear-text.png") no-repeat scroll 0 0;
+ opacity: 0.75;
+ line-height: 0;
+ vertical-align: bottom;
+ cursor: pointer;
+
+ &:hover {
+ opacity: 1;
+ }
+}
+
+.evaluation-input-clear-button.with-scrollbar {
+ margin-right: 29px;
+}
+
+.evaluation-output {
+ margin-top: 1.5em;
+}
+
+.evaluation-input-field,
+.evaluation-output-field {
+ margin-bottom: 0.5em;
+ .box-sizing(border-box);
+ overflow-x: hidden;
+ line-height: @line-height-computed;
+}
+
+.evaluation-output-field {
+ &[readonly] {
+ cursor: auto;
+ background-color: @input-bg;
+ }
+}
+
+.evaluation-error-header {
+ margin-bottom: @line-height-computed;
+ padding-left: 52px;
+ background: transparent url("../images/icons/48x48/error.png") no-repeat scroll 0 50%;
+ color: @black;
+ font-family: @font-family-sans-serif;
+ font-weight: bold;
+ line-height: 48px;
+ vertical-align: middle;
+}
+
+ul.evaluation-error-list,
+ul.evaluation-warning-list {
+ li {
+ margin-bottom: 1em;
+
+ pre {
+ margin-top: 0.5em;
+ white-space: pre;
+ overflow: auto;
+ }
+ }
+}
+
+ul.evaluation-error-list li pre {
+ background-color: @state-danger-bg;
+}
+
+ul.evaluation-warning-list li pre {
+ background-color: @state-warning-bg;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/forms.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/forms.less
new file mode 100644
index 00000000..2ceb0559
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/forms.less
@@ -0,0 +1,99 @@
+//
+// Forms
+// --------------------------------------------------
+
+// GENERAL STYLES
+// --------------
+
+label {
+ font-weight: normal;
+}
+
+
+// Form controls
+// -------------------------
+
+// Common form controls
+.form-control {
+ line-height: @input-height-base;
+}
+
+.textarea-wrapper {
+ position: relative;
+}
+
+// Form groups
+.form-group {
+ margin-bottom: 0.5em;
+}
+
+// Info and errors
+// --------------------------
+.message-info {
+ border: 1px solid;
+ clear: both;
+ padding: 10px 20px;
+ color: @state-info-text;
+}
+
+.message-error {
+ clear: both;
+ color: @state-danger-text;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin: 20px 0 10px 0;
+}
+
+.message-success {
+ color: @state-success-text;
+ font-size: 1.3em;
+ font-weight: bold;
+ margin: 20px 0 10px 0;
+}
+
+.error {
+ color: @state-danger-text;
+}
+
+// Styles for validation helpers
+// --------------------------
+.validators {
+ font-style: normal;
+ padding-bottom: 0.5em;
+}
+
+.field-validation-error {
+ display: block;
+ padding-bottom: 0.5em;
+ color: @state-danger-text;
+ font-weight: bold;
+}
+
+.field-validation-valid {
+ display: none;
+}
+
+input.input-validation-error,
+textarea.input-validation-error,
+select.input-validation-error
+{
+ border: 1px solid @state-danger-border;
+ background-color: @state-danger-bg;
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
+
+ &:focus {
+ border-color: @state-danger-border;
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@state-danger-text, 20%);
+ .box-shadow(@shadow);
+ }
+}
+
+.validation-summary-errors {
+ color: @state-danger-text;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.validation-summary-valid {
+ display: none;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/icons.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/icons.less
new file mode 100644
index 00000000..4a80f963
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/icons.less
@@ -0,0 +1,36 @@
+//
+// Icons
+// --------------------------------------------------
+
+
+.icon {
+ background: transparent url(../images/icons/32x32/social-media-icons-32.png) no-repeat scroll;
+ display: inline-block;
+ line-height: 0;
+ vertical-align: bottom;
+}
+
+.icon-32 {
+ height: 32px;
+ width: 32px;
+}
+
+.icon-mastodon {
+ background-position: 0 0;
+}
+
+.icon-x {
+ background-position: 0 -32px;
+}
+
+.icon-linkedin {
+ background-position: 0 -64px;
+}
+
+.icon-bluesky {
+ background-position: 0 -96px;
+}
+
+.icon-rss {
+ background-position: 0 -128px;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/layout.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/layout.less
new file mode 100644
index 00000000..35a7f386
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/layout.less
@@ -0,0 +1,128 @@
+html,
+body {
+ margin: 0;
+ height: 100%;
+ /* The html and body elements cannot have any padding or margin */
+}
+
+/* Wrapper for page content to push down footer */
+.l-wrapper {
+ min-height: 100%;
+ height: auto !important;
+ height: 100%;
+ /* Negative indent footer by it's height */
+ margin: 0 auto (-1 * @footer-height);
+}
+
+.l-constrained {
+ margin: 0 auto;
+ padding-left: 20px;
+ padding-right: 20px;
+ max-width: 1200px;
+ min-width: 800px;
+}
+
+.l-header {
+ border-top: solid 10px @black;
+ border-bottom: 1px solid #d4b33a;
+ background-color: #f0db4f;
+
+ .l-constrained {
+ padding-top: 20px;
+ padding-bottom: 20px;
+ .clearfix();
+ }
+}
+
+.l-content {
+ .clearfix();
+}
+
+.l-main-content {
+ float: left;
+ width: 70%;
+}
+
+.l-sidebar {
+ float: right;
+ width: 30%;
+}
+
+/* Set the fixed height of the footer here */
+.l-push,
+.l-footer {
+ height: @footer-height;
+}
+
+.l-footer {
+ width: 100%;
+ background-color: @black;
+ color: @gray-lighter;
+ font-size: @font-size-small;
+ line-height: 100%;
+
+ .l-constrained {
+ padding-top: (@footer-height - 32) / 2;
+ .clearfix();
+ }
+
+ a {
+ color: @gray-lighter;
+ text-decoration: none;
+
+ &:hover,
+ &:active {
+ text-decoration: underline;
+ }
+ }
+}
+
+
+// Header
+// -------------------------
+
+.logo {
+ margin: 0;
+
+ a {
+ display: block;
+ float: left;
+ width: 100px;
+ height: 100px;
+ background: transparent url("../images/jsengineswitcher-logo.png") no-repeat scroll 0 0;
+ text-indent: -9999em;
+ }
+}
+
+.primary-nav {
+ position: relative;
+ left: 40px;
+ float: left;
+}
+
+
+// Footer
+// -------------------------
+
+.l-copyright {
+ float: left;
+ p {
+ margin: 0;
+ padding: 0;
+ }
+}
+
+.l-social {
+ float: right;
+
+ li {
+ display: inline;
+ list-style: none outside none;
+ padding-left: 10px;
+
+ a {
+ text-indent: -9999px;
+ outline: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/mixins.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/mixins.less
new file mode 100644
index 00000000..d26eee79
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/mixins.less
@@ -0,0 +1,9 @@
+//
+// Mixins
+// --------------------------------------------------
+
+// NO Drop shadows
+.no-box-shadow {
+ -webkit-box-shadow: none; // iOS <4.3 & Android <4.1
+ box-shadow: none;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/navbar.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/navbar.less
new file mode 100644
index 00000000..95edf3c2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/navbar.less
@@ -0,0 +1,38 @@
+//
+// Navbars
+// --------------------------------------------------
+
+
+// Wrapper and base class
+//
+// Provide a static navbar from which we expand to create full-width, fixed, and
+// other navbar variations.
+
+.navbar {
+ border: none;
+ border-radius: 0;
+}
+
+// Navbar nav links
+//
+// Builds on top of the `.nav` components with it's own modifier class to make
+// the nav the full height of the horizontal nav (above 768px).
+
+.navbar-nav {
+ float: left;
+ margin: 0 auto;
+
+ > li {
+ > a {
+ float: none;
+ // Vertically center the text given @navbar-height
+ padding: ((@navbar-height - @line-height-computed) / 2) 15px ((@navbar-height - @line-height-computed) / 2);
+ border: 1px solid transparent;
+ font-family: "Open Sans", sans-serif;
+ font-size: 2.0em;
+ text-decoration: none;
+ text-transform: uppercase;
+ outline: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/page-socials.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/page-socials.less
new file mode 100644
index 00000000..ea12dc09
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/page-socials.less
@@ -0,0 +1,14 @@
+.page-socials {
+ min-height: 60px;
+ margin-top: 20px;
+ padding-top: 15px;
+ border-top: 1px solid #b2b2b2;
+}
+
+.share-buttons {
+ li {
+ margin-right: 15px;
+ vertical-align: top;
+ line-height: normal;
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/type.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/type.less
new file mode 100644
index 00000000..02d69502
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/type.less
@@ -0,0 +1,24 @@
+//
+// Typography
+// --------------------------------------------------
+
+// Headings
+// -------------------------
+
+h1, h2, h3 {
+ margin-top: 10px;
+}
+
+h1, h2 {
+ line-height: 40px;
+}
+
+h2 {
+ color: @black;
+ font-weight: bold;
+}
+
+h3 {
+ color: @gray-dark;
+ line-height: @line-height-computed * 1.25;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/variables.less b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/variables.less
new file mode 100644
index 00000000..498c9796
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/styles/variables.less
@@ -0,0 +1,7 @@
+// Colors
+// -------------------------
+@black: #1d0d0d;
+
+// Footer
+// -------------------------
+@footer-height: 55px;
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/.bowerrc b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/.bowerrc
new file mode 100644
index 00000000..ea81a597
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/.bowerrc
@@ -0,0 +1,4 @@
+{
+ "registry": "https://registry.bower.io",
+ "directory": "wwwroot/lib"
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets.csproj
new file mode 100644
index 00000000..ae4c7d82
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets.csproj
@@ -0,0 +1,11 @@
+
+
+
+ JS Engine Switcher: Client-Side Assets for ASP.NET Core Samples
+ 3.30.2
+ netstandard2.0
+ Library
+ false
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/bower.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/bower.json
new file mode 100644
index 00000000..3a9323a2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/bower.json
@@ -0,0 +1,11 @@
+{
+ "name": "javascriptengineswitcher.sample.aspnetcore.clientsideassets",
+ "dependencies": {
+ "modernizr": "2.8.3",
+ "jquery-compat": "jquery#1.10.2",
+ "jquery": "jquery#2.0.3",
+ "jquery-validation": "1.13.1",
+ "jquery-validation-unobtrusive": "3.2.3",
+ "bootstrap": "3.3.0"
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.cmd b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.cmd
new file mode 100644
index 00000000..de3af278
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.cmd
@@ -0,0 +1,41 @@
+@echo off
+setlocal
+
+::--------------------------------------------------------------------------------
+:: Build
+::--------------------------------------------------------------------------------
+
+echo Starting to build the frontend for ASP.NET Core samples ...
+echo.
+
+echo Installing Node.js packages ...
+echo.
+call npm install
+if errorlevel 1 goto error
+echo.
+
+echo Installing Bower packages ...
+echo.
+call bower install
+if errorlevel 1 goto error
+echo.
+
+echo Building client-side assets ...
+echo.
+call gulp
+if errorlevel 1 goto error
+echo.
+
+::--------------------------------------------------------------------------------
+:: Exit
+::--------------------------------------------------------------------------------
+
+echo Succeeded!
+goto exit
+
+:error
+echo *** Error: The previous step failed!
+
+:exit
+cd ../../
+endlocal
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.sh b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.sh
new file mode 100644
index 00000000..06a7afd9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/build-frontend.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+function handle_error()
+{
+ _RET=${PIPESTATUS[0]}
+ if [[ $_RET != 0 ]]; then
+ echo "*** Error: The previous step failed!"
+
+ cd ../../
+ exit $_RET
+ fi
+}
+
+echo "Starting to build the frontend for ASP.NET Core samples ..."
+echo ""
+
+echo "Installing Node.js packages ..."
+echo ""
+npm install
+handle_error
+echo ""
+
+echo "Installing Bower packages ..."
+echo ""
+bower install
+handle_error
+echo ""
+
+echo "Building client-side assets ..."
+echo ""
+gulp
+handle_error
+echo ""
+
+echo "Succeeded!"
+
+cd ../../
+exit $_RET
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/ensure-client-side-assets-builded.targets b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/ensure-client-side-assets-builded.targets
new file mode 100644
index 00000000..3f41ba35
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/ensure-client-side-assets-builded.targets
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/gulpfile.js b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/gulpfile.js
new file mode 100644
index 00000000..0f259437
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/gulpfile.js
@@ -0,0 +1,130 @@
+/*global require, exports */
+/*jshint esversion: 6 */
+const WEB_ROOT_PATH = "wwwroot";
+const BOWER_DIR_PATH = WEB_ROOT_PATH + "/lib";
+const STYLE_DIR_PATH = WEB_ROOT_PATH + '/styles';
+const SCRIPT_DIR_PATH = WEB_ROOT_PATH + '/scripts';
+
+// include plug-ins
+let { src, dest, series, parallel, watch } = require('gulp');
+let del = require('del');
+let sourcemaps = require('gulp-sourcemaps');
+let rename = require('gulp-rename');
+let concat = require('gulp-concat');
+let less = require('gulp-less');
+let autoprefixer = require('gulp-autoprefixer');
+let cleanCss = require('gulp-clean-css');
+let uglify = require('gulp-uglify');
+
+//#region Clean
+//#region Clean builded assets
+function cleanBuildedStyles() {
+ return del([STYLE_DIR_PATH + '/build/*']);
+}
+
+function cleanBuildedScripts() {
+ return del([SCRIPT_DIR_PATH + '/build/*']);
+}
+
+let cleanBuildedAssets = parallel(cleanBuildedStyles, cleanBuildedScripts);
+//#endregion
+//#endregion
+
+//#region Build assets
+//#region Build styles
+let autoprefixerOptions = {
+ overrideBrowserslist: ['> 1%', 'last 3 versions', 'Firefox ESR', 'Opera 12.1'],
+ cascade: true
+};
+let cssCleanOptions = { specialComments: '*' };
+let cssRenameOptions = { extname: '.min.css' };
+
+function buildCommonStyles() {
+ return src([STYLE_DIR_PATH + '/app.less'])
+ .pipe(sourcemaps.init())
+ .pipe(less({
+ relativeUrls: true,
+ rootpath: '/styles/'
+ }))
+ .pipe(autoprefixer(autoprefixerOptions))
+ .pipe(sourcemaps.write('./'))
+ .pipe(dest(STYLE_DIR_PATH + '/build'))
+ .pipe(sourcemaps.init({ loadMaps: true }))
+ .pipe(concat('common-styles.css'))
+ .pipe(cleanCss(cssCleanOptions))
+ .pipe(rename(cssRenameOptions))
+ .pipe(sourcemaps.write('./'))
+ .pipe(dest(STYLE_DIR_PATH + '/build'))
+ ;
+}
+
+let buildStyles = buildCommonStyles;
+//#endregion
+
+//#region Build scripts
+let jsConcatOptions = { newLine: ';' };
+let jsUglifyOptions = {
+ output: { comments: /^!/ }
+};
+let jsRenameOptions = { extname: '.min.js' };
+
+function buildModernizrScripts() {
+ return src([BOWER_DIR_PATH + '/modernizr/modernizr.js'])
+ .pipe(sourcemaps.init())
+ .pipe(uglify(jsUglifyOptions))
+ .pipe(rename(jsRenameOptions))
+ .pipe(sourcemaps.write('./'))
+ .pipe(dest(SCRIPT_DIR_PATH + '/build'))
+ ;
+}
+
+function buildCommonScripts() {
+ return src([SCRIPT_DIR_PATH + '/common.js'])
+ .pipe(sourcemaps.init({ loadMaps: true }))
+ .pipe(rename({ basename: 'common-scripts' }))
+ .pipe(uglify(jsUglifyOptions))
+ .pipe(rename(jsRenameOptions))
+ .pipe(sourcemaps.write('./'))
+ .pipe(dest(SCRIPT_DIR_PATH + '/build'))
+ ;
+}
+
+function buildEvaluationFormScripts() {
+ return src([BOWER_DIR_PATH + '/jquery-validation/dist/jquery.validate.js',
+ BOWER_DIR_PATH + '/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js',
+ BOWER_DIR_PATH + '/bootstrap/js/button.js',
+ SCRIPT_DIR_PATH + '/evaluation-form.js'])
+ .pipe(sourcemaps.init({ loadMaps: true }))
+ .pipe(concat('evaluation-form-scripts.js', jsConcatOptions))
+ .pipe(uglify(jsUglifyOptions))
+ .pipe(rename(jsRenameOptions))
+ .pipe(sourcemaps.write('./'))
+ .pipe(dest(SCRIPT_DIR_PATH + '/build'))
+ ;
+}
+
+let buildScripts = parallel(buildModernizrScripts, buildCommonScripts, buildEvaluationFormScripts);
+//#endregion
+
+let buildAssets = parallel(buildStyles, buildScripts);
+//#endregion
+
+//#region Watch assets
+function watchStyles() {
+ return watch([STYLE_DIR_PATH + '/**/*.{less,css}', '!' + STYLE_DIR_PATH + '/build/**/*.*'],
+ buildStyles);
+}
+
+function watchScripts() {
+ return watch([SCRIPT_DIR_PATH + '/**/*.js', '!' + SCRIPT_DIR_PATH + '/build/**/*.*'],
+ buildScripts);
+}
+
+let watchAssets = parallel(watchStyles, watchScripts);
+//#endregion
+
+// Export tasks
+exports.cleanBuildedAssets = cleanBuildedAssets;
+exports.buildAssets = buildAssets;
+exports.watchAssets = watchAssets;
+exports.default = series(cleanBuildedAssets, buildAssets);
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/package.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/package.json
new file mode 100644
index 00000000..725f9bac
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "javascriptengineswitcher.sample.aspnetcore.clientsideassets",
+ "private": true,
+ "version": "3.30.2",
+ "devDependencies": {
+ "gulp": "4.0.2",
+ "del": "5.1.0",
+ "gulp-sourcemaps": "2.6.5",
+ "gulp-rename": "2.0.0",
+ "gulp-concat": "2.6.1",
+ "gulp-less": "4.0.1",
+ "gulp-autoprefixer": "7.0.1",
+ "gulp-clean-css": "4.2.0",
+ "gulp-uglify": "3.0.2"
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/0.gif b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/0.gif
new file mode 100644
index 00000000..35d42e80
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/0.gif differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/clear-text.png b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/clear-text.png
new file mode 100644
index 00000000..9d217b7f
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/clear-text.png differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/32x32/social-media-icons-32.png b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/32x32/social-media-icons-32.png
new file mode 100644
index 00000000..30d1c781
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/32x32/social-media-icons-32.png differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/48x48/error.png b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/48x48/error.png
new file mode 100644
index 00000000..3d6185f7
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/icons/48x48/error.png differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/jsengineswitcher-logo.png b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/jsengineswitcher-logo.png
new file mode 100644
index 00000000..12ed97e0
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/images/jsengineswitcher-logo.png differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/_references.js b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/_references.js
new file mode 100644
index 00000000..2b54eea8
Binary files /dev/null and b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/_references.js differ
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/common.js b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/common.js
new file mode 100644
index 00000000..c94bf102
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/common.js
@@ -0,0 +1,29 @@
+var jsEngineSwitcher;
+
+(function (jsEngineSwitcher, undefined) {
+ "use strict";
+
+ jsEngineSwitcher.registerNamespace = function (namespaceString) {
+ var parts = namespaceString.split("."),
+ parent = jsEngineSwitcher,
+ i
+ ;
+
+ if (parts[0] === "jsEngineSwitcher") {
+ parts = parts.slice(1);
+ }
+
+ for (i = 0; i < parts.length; i += 1) {
+ if (typeof parent[parts[i]] === "undefined") {
+ parent[parts[i]] = {};
+ }
+ parent = parent[parts[i]];
+ }
+
+ return parent;
+ };
+
+ jsEngineSwitcher.hasScrollbar = function(elem) {
+ return (elem.clientHeight < elem.scrollHeight);
+ };
+}(jsEngineSwitcher = jsEngineSwitcher || {}));
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/evaluation-form.js b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/evaluation-form.js
new file mode 100644
index 00000000..da1f0199
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/scripts/evaluation-form.js
@@ -0,0 +1,83 @@
+(function (jsEngineSwitcher, $, undefined) {
+ "use strict";
+
+ var $evaluationForm,
+ $evaluationInputField,
+ $evaluationInputClearButton,
+ $evaluateButton
+ ;
+
+ $(function () {
+ $evaluationForm = $("form[data-form-type='evaluation-form']");
+ $evaluationInputField = $(":input[data-control-type='evaluation-input-field']", $evaluationForm);
+ $evaluationInputClearButton = $("");
+ $evaluateButton = $(":input[data-control-type='evaluate-button']", $evaluationForm);
+
+ $evaluationForm.on("submit", onEvaluationFormSubmitHandler);
+
+ $evaluationInputClearButton.on("click", onEvaluationInputClearButtonClickHandler);
+ $evaluationInputField.parent().append($evaluationInputClearButton);
+ refreshEvaluationInputClearButton();
+ $evaluationInputField
+ .on("input propertychange keydown keyup paste", onEvaluationInputFieldChangeHandler)
+ ;
+
+ $evaluateButton.removeAttr("disabled");
+ });
+
+ $(window).unload(function() {
+ $evaluationForm.off("submit", onEvaluationFormSubmitHandler);
+
+ $evaluationInputClearButton
+ .off("click", onEvaluationInputClearButtonClickHandler)
+ .remove()
+ ;
+
+ $evaluationInputField
+ .off("input propertychange keydown keyup paste", onEvaluationInputFieldChangeHandler)
+ ;
+
+ $evaluationForm = null;
+ $evaluationInputField = null;
+ $evaluationInputClearButton = null;
+ $evaluateButton = null;
+ });
+
+ var refreshEvaluationInputClearButton = function() {
+ if ($.trim($evaluationInputField.val()).length > 0) {
+ $evaluationInputClearButton.show();
+ } else {
+ $evaluationInputClearButton.hide();
+ }
+
+ if (jsEngineSwitcher.hasScrollbar($evaluationInputField.get(0))) {
+ $evaluationInputClearButton.addClass("with-scrollbar");
+ }
+ else {
+ $evaluationInputClearButton.removeClass("with-scrollbar");
+ }
+ };
+
+ var onEvaluationFormSubmitHandler = function () {
+ var $form = $(this);
+ if ($form.valid()) {
+ $evaluateButton.attr("disabled", "disabled");
+ $("textarea[data-control-type='evaluation-output-field']", $form).val('');
+
+ return true;
+ }
+
+ return false;
+ };
+
+ var onEvaluationInputFieldChangeHandler = function () {
+ refreshEvaluationInputClearButton();
+ };
+
+ var onEvaluationInputClearButtonClickHandler = function() {
+ $evaluationInputField.val("");
+
+ var $button = $(this);
+ $button.hide();
+ };
+}(jsEngineSwitcher, jQuery));
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/app.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/app.less
new file mode 100644
index 00000000..c41a9315
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/app.less
@@ -0,0 +1,71 @@
+/*!
+ * Bootstrap v3.3.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+// Core variables and mixins
+@import "bootstrap-custom-variables.less";
+@import "../lib/bootstrap/less/mixins.less";
+
+// Reset
+@import "../lib/bootstrap/less/normalize.less";
+//@import "../lib/bootstrap/less/print.less";
+//@import "../lib/bootstrap/less/glyphicons.less";
+
+// Core CSS
+@import "../lib/bootstrap/less/scaffolding.less";
+@import "../lib/bootstrap/less/type.less";
+@import "../lib/bootstrap/less/code.less";
+//@import "../lib/bootstrap/less/grid.less";
+//@import "../lib/bootstrap/less/tables.less";
+@import "../lib/bootstrap/less/forms.less";
+//@import "../lib/bootstrap/less/buttons.less";
+
+// Components
+//@import "../lib/bootstrap/less/component-animations.less";
+//@import "../lib/bootstrap/less/dropdowns.less";
+//@import "../lib/bootstrap/less/button-groups.less";
+//@import "../lib/bootstrap/less/input-groups.less";
+@import "../lib/bootstrap/less/navs.less";
+@import "../lib/bootstrap/less/navbar.less";
+//@import "../lib/bootstrap/less/breadcrumbs.less";
+//@import "../lib/bootstrap/less/pagination.less";
+//@import "../lib/bootstrap/less/pager.less";
+//@import "../lib/bootstrap/less/labels.less";
+//@import "../lib/bootstrap/less/badges.less";
+//@import "../lib/bootstrap/less/jumbotron.less";
+//@import "../lib/bootstrap/less/thumbnails.less";
+//@import "../lib/bootstrap/less/alerts.less";
+//@import "../lib/bootstrap/less/progress-bars.less";
+//@import "../lib/bootstrap/less/media.less";
+//@import "../lib/bootstrap/less/list-group.less";
+//@import "../lib/bootstrap/less/panels.less";
+//@import "../lib/bootstrap/less/responsive-embed.less";
+//@import "../lib/bootstrap/less/wells.less";
+//@import "../lib/bootstrap/less/close.less";
+
+// Components w/ JavaScript
+//@import "../lib/bootstrap/less/modals.less";
+//@import "../lib/bootstrap/less/tooltip.less";
+//@import "../lib/bootstrap/less/popovers.less";
+//@import "../lib/bootstrap/less/carousel.less";
+
+// Utility classes
+@import "../lib/bootstrap/less/utilities.less";
+//@import "../lib/bootstrap/less/responsive-utilities.less";
+
+// JavaScriptEngineSwitcher specs
+@import "variables.less";
+@import "mixins.less";
+
+@import "type.less";
+@import "code.less";
+@import "forms.less";
+@import "buttons.less";
+@import "icons.less";
+@import "navbar.less";
+
+@import "layout.less";
+@import "evaluation-form.less";
+@import "page-socials.less";
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/bootstrap-custom-variables.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/bootstrap-custom-variables.less
new file mode 100644
index 00000000..0be2aa6f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/bootstrap-custom-variables.less
@@ -0,0 +1,856 @@
+//
+// Variables
+// --------------------------------------------------
+
+
+//== Colors
+//
+//## Gray and brand colors for use across Bootstrap.
+
+@gray-base: #323330;
+@gray-darker: lighten(@gray-base, 13.5%); // #222
+@gray-dark: lighten(@gray-base, 20%); // #333
+@gray: lighten(@gray-base, 33.5%); // #555
+@gray-light: lighten(@gray-base, 46.7%); // #777
+@gray-lighter: #e3e3e3;
+
+@brand-primary: #428bca;
+@brand-success: #5cb85c;
+@brand-info: #5bc0de;
+@brand-warning: #f0ad4e;
+@brand-danger: #d9534f;
+
+
+//== Scaffolding
+//
+//## Settings for some of the most global styles.
+
+//** Background color for ``.
+@body-bg: #fff;
+//** Global text color on ``.
+@text-color: #1d0d0d;
+
+//** Global textual link color.
+@link-color: @brand-primary;
+//** Link hover color set via `darken()` function.
+@link-hover-color: darken(@link-color, 15%);
+//** Link hover decoration.
+@link-hover-decoration: underline;
+
+
+//== Typography
+//
+//## Font, line-height, and color for body text, headings, and more.
+
+@font-family-sans-serif: "Helvetica Neue", Arial, sans-serif;
+@font-family-serif: Georgia, "Times New Roman", Times, serif;
+//** Default monospace fonts for ``, ``, and ``.
+@font-family-monospace: Consolas, "Courier New", monospace;
+@font-family-base: @font-family-sans-serif;
+
+@font-size-base: 14px;
+@font-size-large: ceil((@font-size-base * 1.25)); // ~18px
+@font-size-small: ceil((@font-size-base * 0.85)); // ~12px
+
+@font-size-h1: floor(@font-size-base * 3);
+@font-size-h2: @font-size-base * 2.5;
+@font-size-h3: ceil(@font-size-base * 1.75);
+@font-size-h4: ceil(@font-size-base * 1.25);
+@font-size-h5: @font-size-base;
+@font-size-h6: ceil(@font-size-base * 0.85);
+
+//** Unit-less `line-height` for use in components like buttons.
+@line-height-base: 1.428571429; // 20/14
+//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
+@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px
+
+//** By default, this inherits from the ``.
+@headings-font-family: "Open Sans", sans-serif;
+@headings-font-weight: normal;
+@headings-line-height: 1.1;
+@headings-color: inherit;
+
+
+//== Iconography
+//
+//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
+
+//** Load fonts from this directory.
+@icon-font-path: "../fonts/";
+//** File name for all font files.
+@icon-font-name: "glyphicons-halflings-regular";
+//** Element ID within SVG icon file.
+@icon-font-svg-id: "glyphicons_halflingsregular";
+
+
+//== Components
+//
+//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
+
+@padding-base-vertical: 4px;
+@padding-base-horizontal: 6px;
+
+@padding-large-vertical: 10px;
+@padding-large-horizontal: 16px;
+
+@padding-small-vertical: 5px;
+@padding-small-horizontal: 10px;
+
+@padding-xs-vertical: 1px;
+@padding-xs-horizontal: 5px;
+
+@line-height-large: 1.33;
+@line-height-small: 1.5;
+
+@border-radius-base: 4px;
+@border-radius-large: 6px;
+@border-radius-small: 3px;
+
+//** Global color for active items (e.g., navs or dropdowns).
+@component-active-color: #fff;
+//** Global background color for active items (e.g., navs or dropdowns).
+@component-active-bg: @brand-primary;
+
+//** Width of the `border` for generating carets that indicator dropdowns.
+@caret-width-base: 4px;
+//** Carets increase slightly in size for larger components.
+@caret-width-large: 5px;
+
+
+//== Tables
+//
+//## Customizes the `.table` component with basic values, each used across all table variations.
+
+//** Padding for ``s and ` `s.
+@table-cell-padding: 8px;
+//** Padding for cells in `.table-condensed`.
+@table-condensed-cell-padding: 5px;
+
+//** Default background color used for all tables.
+@table-bg: transparent;
+//** Background color used for `.table-striped`.
+@table-bg-accent: #f9f9f9;
+//** Background color used for `.table-hover`.
+@table-bg-hover: #f5f5f5;
+@table-bg-active: @table-bg-hover;
+
+//** Border color for table and cell borders.
+@table-border-color: #ddd;
+
+
+//== Buttons
+//
+//## For each of Bootstrap's buttons, define text, background and border color.
+
+@btn-font-weight: normal;
+
+@btn-default-color: #333;
+@btn-default-bg: @gray-lighter;
+@btn-default-border: @gray-lighter;
+
+@btn-primary-color: #fff;
+@btn-primary-bg: @brand-primary;
+@btn-primary-border: darken(@btn-primary-bg, 5%);
+
+@btn-success-color: #fff;
+@btn-success-bg: @brand-success;
+@btn-success-border: darken(@btn-success-bg, 5%);
+
+@btn-info-color: #fff;
+@btn-info-bg: @brand-info;
+@btn-info-border: darken(@btn-info-bg, 5%);
+
+@btn-warning-color: #fff;
+@btn-warning-bg: @brand-warning;
+@btn-warning-border: darken(@btn-warning-bg, 5%);
+
+@btn-danger-color: #fff;
+@btn-danger-bg: @brand-danger;
+@btn-danger-border: darken(@btn-danger-bg, 5%);
+
+@btn-link-disabled-color: @gray-light;
+
+
+//== Forms
+//
+//##
+
+//** `` background color
+@input-bg: #fff;
+//** `` background color
+@input-bg-disabled: @gray-lighter;
+
+//** Text color for ``s
+@input-color: @gray;
+//** `` border color
+@input-border: #b2b2b2;
+
+// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
+//** Default `.form-control` border radius
+@input-border-radius: @border-radius-base;
+//** Large `.form-control` border radius
+@input-border-radius-large: @border-radius-large;
+//** Small `.form-control` border radius
+@input-border-radius-small: @border-radius-small;
+
+//** Border color for inputs on focus
+@input-border-focus: #d4b33a;
+
+//** Placeholder text color
+@input-color-placeholder: #999;
+
+//** Default `.form-control` height
+@input-height-base: (@line-height-computed + (@padding-base-vertical * 2) + 2);
+//** Large `.form-control` height
+@input-height-large: (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
+//** Small `.form-control` height
+@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
+
+@legend-color: @gray-dark;
+@legend-border-color: #e5e5e5;
+
+//** Background color for textual input addons
+@input-group-addon-bg: @gray-lighter;
+//** Border color for textual input addons
+@input-group-addon-border-color: @input-border;
+
+//** Disabled cursor for form controls and buttons.
+@cursor-disabled: not-allowed;
+
+
+//== Dropdowns
+//
+//## Dropdown menu container and contents.
+
+//** Background for the dropdown menu.
+@dropdown-bg: #fff;
+//** Dropdown menu `border-color`.
+@dropdown-border: rgba(0,0,0,.15);
+//** Dropdown menu `border-color` **for IE8**.
+@dropdown-fallback-border: #ccc;
+//** Divider color for between dropdown items.
+@dropdown-divider-bg: #e5e5e5;
+
+//** Dropdown link text color.
+@dropdown-link-color: @gray-dark;
+//** Hover color for dropdown links.
+@dropdown-link-hover-color: darken(@gray-dark, 5%);
+//** Hover background for dropdown links.
+@dropdown-link-hover-bg: #f5f5f5;
+
+//** Active dropdown menu item text color.
+@dropdown-link-active-color: @component-active-color;
+//** Active dropdown menu item background color.
+@dropdown-link-active-bg: @component-active-bg;
+
+//** Disabled dropdown menu item background color.
+@dropdown-link-disabled-color: @gray-light;
+
+//** Text color for headers within dropdown menus.
+@dropdown-header-color: @gray-light;
+
+//** Deprecated `@dropdown-caret-color` as of v3.1.0
+@dropdown-caret-color: #000;
+
+
+//-- Z-index master list
+//
+// Warning: Avoid customizing these values. They're used for a bird's eye view
+// of components dependent on the z-axis and are designed to all work together.
+//
+// Note: These variables are not generated into the Customizer.
+
+@zindex-navbar: 1000;
+@zindex-dropdown: 1000;
+@zindex-popover: 1060;
+@zindex-tooltip: 1070;
+@zindex-navbar-fixed: 1030;
+@zindex-modal: 1040;
+
+
+//== Media queries breakpoints
+//
+//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
+
+// Extra small screen / phone
+//** Deprecated `@screen-xs` as of v3.0.1
+@screen-xs: 480px;
+//** Deprecated `@screen-xs-min` as of v3.2.0
+@screen-xs-min: @screen-xs;
+//** Deprecated `@screen-phone` as of v3.0.1
+@screen-phone: @screen-xs-min;
+
+// Small screen / tablet
+//** Deprecated `@screen-sm` as of v3.0.1
+@screen-sm: 768px;
+@screen-sm-min: @screen-sm;
+//** Deprecated `@screen-tablet` as of v3.0.1
+@screen-tablet: @screen-sm-min;
+
+// Medium screen / desktop
+//** Deprecated `@screen-md` as of v3.0.1
+@screen-md: 992px;
+@screen-md-min: @screen-md;
+//** Deprecated `@screen-desktop` as of v3.0.1
+@screen-desktop: @screen-md-min;
+
+// Large screen / wide desktop
+//** Deprecated `@screen-lg` as of v3.0.1
+@screen-lg: 1200px;
+@screen-lg-min: @screen-lg;
+//** Deprecated `@screen-lg-desktop` as of v3.0.1
+@screen-lg-desktop: @screen-lg-min;
+
+// So media queries don't overlap when required, provide a maximum
+@screen-xs-max: (@screen-sm-min - 1);
+@screen-sm-max: (@screen-md-min - 1);
+@screen-md-max: (@screen-lg-min - 1);
+
+
+//== Grid system
+//
+//## Define your custom responsive grid.
+
+//** Number of columns in the grid.
+@grid-columns: 12;
+//** Padding between columns. Gets divided in half for the left and right.
+@grid-gutter-width: 30px;
+// Navbar collapse
+//** Point at which the navbar becomes uncollapsed.
+@grid-float-breakpoint: @screen-sm-min;
+//** Point at which the navbar begins collapsing.
+@grid-float-breakpoint-max: (@grid-float-breakpoint - 1);
+
+
+//== Container sizes
+//
+//## Define the maximum width of `.container` for different screen sizes.
+
+// Small screen / tablet
+@container-tablet: (720px + @grid-gutter-width);
+//** For `@screen-sm-min` and up.
+@container-sm: @container-tablet;
+
+// Medium screen / desktop
+@container-desktop: (940px + @grid-gutter-width);
+//** For `@screen-md-min` and up.
+@container-md: @container-desktop;
+
+// Large screen / wide desktop
+@container-large-desktop: (1140px + @grid-gutter-width);
+//** For `@screen-lg-min` and up.
+@container-lg: @container-large-desktop;
+
+
+//== Navbar
+//
+//##
+
+// Basics of a navbar
+@navbar-height: 100px;
+@navbar-margin-bottom: 0;
+@navbar-border-radius: @border-radius-base;
+@navbar-padding-horizontal: 0;
+@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
+@navbar-collapse-max-height: 340px;
+
+@navbar-default-color: @gray-base;
+@navbar-default-bg: #f0db4f;
+@navbar-default-border: #f0db4f;
+
+// Navbar links
+@navbar-default-link-color: @navbar-default-color;
+@navbar-default-link-hover-color: @gray-dark;
+@navbar-default-link-hover-bg: transparent;
+@navbar-default-link-active-color: @navbar-default-color;
+@navbar-default-link-active-bg: transparent;
+@navbar-default-link-disabled-color: #ccc;
+@navbar-default-link-disabled-bg: transparent;
+
+// Navbar brand label
+@navbar-default-brand-color: @navbar-default-link-color;
+@navbar-default-brand-hover-color: darken(@navbar-default-brand-color, 10%);
+@navbar-default-brand-hover-bg: transparent;
+
+// Navbar toggle
+@navbar-default-toggle-hover-bg: #ddd;
+@navbar-default-toggle-icon-bar-bg: @gray-dark;
+@navbar-default-toggle-border-color: #ddd;
+
+
+// Inverted navbar
+// Reset inverted navbar basics
+@navbar-inverse-color: lighten(@gray-light, 15%);
+@navbar-inverse-bg: #222;
+@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
+
+// Inverted navbar links
+@navbar-inverse-link-color: lighten(@gray-light, 15%);
+@navbar-inverse-link-hover-color: #fff;
+@navbar-inverse-link-hover-bg: transparent;
+@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color;
+@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%);
+@navbar-inverse-link-disabled-color: #444;
+@navbar-inverse-link-disabled-bg: transparent;
+
+// Inverted navbar brand label
+@navbar-inverse-brand-color: @navbar-inverse-link-color;
+@navbar-inverse-brand-hover-color: #fff;
+@navbar-inverse-brand-hover-bg: transparent;
+
+// Inverted navbar toggle
+@navbar-inverse-toggle-hover-bg: #333;
+@navbar-inverse-toggle-icon-bar-bg: #fff;
+@navbar-inverse-toggle-border-color: #333;
+
+
+//== Navs
+//
+//##
+
+//=== Shared nav styles
+@nav-link-padding: 10px 15px;
+@nav-link-hover-bg: @gray-lighter;
+
+@nav-disabled-link-color: @gray-light;
+@nav-disabled-link-hover-color: @gray-light;
+
+//== Tabs
+@nav-tabs-border-color: #ddd;
+
+@nav-tabs-link-hover-border-color: @gray-lighter;
+
+@nav-tabs-active-link-hover-bg: @body-bg;
+@nav-tabs-active-link-hover-color: @gray;
+@nav-tabs-active-link-hover-border-color: #ddd;
+
+@nav-tabs-justified-link-border-color: #ddd;
+@nav-tabs-justified-active-link-border-color: @body-bg;
+
+//== Pills
+@nav-pills-border-radius: @border-radius-base;
+@nav-pills-active-link-hover-bg: @component-active-bg;
+@nav-pills-active-link-hover-color: @component-active-color;
+
+
+//== Pagination
+//
+//##
+
+@pagination-color: @link-color;
+@pagination-bg: #fff;
+@pagination-border: #ddd;
+
+@pagination-hover-color: @link-hover-color;
+@pagination-hover-bg: @gray-lighter;
+@pagination-hover-border: #ddd;
+
+@pagination-active-color: #fff;
+@pagination-active-bg: @brand-primary;
+@pagination-active-border: @brand-primary;
+
+@pagination-disabled-color: @gray-light;
+@pagination-disabled-bg: #fff;
+@pagination-disabled-border: #ddd;
+
+
+//== Pager
+//
+//##
+
+@pager-bg: @pagination-bg;
+@pager-border: @pagination-border;
+@pager-border-radius: 15px;
+
+@pager-hover-bg: @pagination-hover-bg;
+
+@pager-active-bg: @pagination-active-bg;
+@pager-active-color: @pagination-active-color;
+
+@pager-disabled-color: @pagination-disabled-color;
+
+
+//== Jumbotron
+//
+//##
+
+@jumbotron-padding: 30px;
+@jumbotron-color: inherit;
+@jumbotron-bg: @gray-lighter;
+@jumbotron-heading-color: inherit;
+@jumbotron-font-size: ceil((@font-size-base * 1.5));
+
+
+//== Form states and alerts
+//
+//## Define colors for form feedback states and, by default, alerts.
+
+@state-success-text: #3c763d;
+@state-success-bg: #dff0d8;
+@state-success-border: darken(spin(@state-success-bg, -10), 5%);
+
+@state-info-text: #31708f;
+@state-info-bg: #d9edf7;
+@state-info-border: darken(spin(@state-info-bg, -10), 7%);
+
+@state-warning-text: #8a6d3b;
+@state-warning-bg: #fcf8e3;
+@state-warning-border: darken(spin(@state-warning-bg, -10), 5%);
+
+@state-danger-text: #a94442;
+@state-danger-bg: #f2dede;
+@state-danger-border: darken(spin(@state-danger-bg, -10), 5%);
+
+
+//== Tooltips
+//
+//##
+
+//** Tooltip max width
+@tooltip-max-width: 200px;
+//** Tooltip text color
+@tooltip-color: #fff;
+//** Tooltip background color
+@tooltip-bg: #000;
+@tooltip-opacity: .9;
+
+//** Tooltip arrow width
+@tooltip-arrow-width: 5px;
+//** Tooltip arrow color
+@tooltip-arrow-color: @tooltip-bg;
+
+
+//== Popovers
+//
+//##
+
+//** Popover body background color
+@popover-bg: #fff;
+//** Popover maximum width
+@popover-max-width: 276px;
+//** Popover border color
+@popover-border-color: rgba(0,0,0,.2);
+//** Popover fallback border color
+@popover-fallback-border-color: #ccc;
+
+//** Popover title background color
+@popover-title-bg: darken(@popover-bg, 3%);
+
+//** Popover arrow width
+@popover-arrow-width: 10px;
+//** Popover arrow color
+@popover-arrow-color: @popover-bg;
+
+//** Popover outer arrow width
+@popover-arrow-outer-width: (@popover-arrow-width + 1);
+//** Popover outer arrow color
+@popover-arrow-outer-color: fadein(@popover-border-color, 5%);
+//** Popover outer arrow fallback color
+@popover-arrow-outer-fallback-color: darken(@popover-fallback-border-color, 20%);
+
+
+//== Labels
+//
+//##
+
+//** Default label background color
+@label-default-bg: @gray-light;
+//** Primary label background color
+@label-primary-bg: @brand-primary;
+//** Success label background color
+@label-success-bg: @brand-success;
+//** Info label background color
+@label-info-bg: @brand-info;
+//** Warning label background color
+@label-warning-bg: @brand-warning;
+//** Danger label background color
+@label-danger-bg: @brand-danger;
+
+//** Default label text color
+@label-color: #fff;
+//** Default text color of a linked label
+@label-link-hover-color: #fff;
+
+
+//== Modals
+//
+//##
+
+//** Padding applied to the modal body
+@modal-inner-padding: 15px;
+
+//** Padding applied to the modal title
+@modal-title-padding: 15px;
+//** Modal title line-height
+@modal-title-line-height: @line-height-base;
+
+//** Background color of modal content area
+@modal-content-bg: #fff;
+//** Modal content border color
+@modal-content-border-color: rgba(0,0,0,.2);
+//** Modal content border color **for IE8**
+@modal-content-fallback-border-color: #999;
+
+//** Modal backdrop background color
+@modal-backdrop-bg: #000;
+//** Modal backdrop opacity
+@modal-backdrop-opacity: .5;
+//** Modal header border color
+@modal-header-border-color: #e5e5e5;
+//** Modal footer border color
+@modal-footer-border-color: @modal-header-border-color;
+
+@modal-lg: 900px;
+@modal-md: 600px;
+@modal-sm: 300px;
+
+
+//== Alerts
+//
+//## Define alert colors, border radius, and padding.
+
+@alert-padding: 15px;
+@alert-border-radius: @border-radius-base;
+@alert-link-font-weight: bold;
+
+@alert-success-bg: @state-success-bg;
+@alert-success-text: @state-success-text;
+@alert-success-border: @state-success-border;
+
+@alert-info-bg: @state-info-bg;
+@alert-info-text: @state-info-text;
+@alert-info-border: @state-info-border;
+
+@alert-warning-bg: @state-warning-bg;
+@alert-warning-text: @state-warning-text;
+@alert-warning-border: @state-warning-border;
+
+@alert-danger-bg: @state-danger-bg;
+@alert-danger-text: @state-danger-text;
+@alert-danger-border: @state-danger-border;
+
+
+//== Progress bars
+//
+//##
+
+//** Background color of the whole progress component
+@progress-bg: #f5f5f5;
+//** Progress bar text color
+@progress-bar-color: #fff;
+//** Variable for setting rounded corners on progress bar.
+@progress-border-radius: @border-radius-base;
+
+//** Default progress bar color
+@progress-bar-bg: @brand-primary;
+//** Success progress bar color
+@progress-bar-success-bg: @brand-success;
+//** Warning progress bar color
+@progress-bar-warning-bg: @brand-warning;
+//** Danger progress bar color
+@progress-bar-danger-bg: @brand-danger;
+//** Info progress bar color
+@progress-bar-info-bg: @brand-info;
+
+
+//== List group
+//
+//##
+
+//** Background color on `.list-group-item`
+@list-group-bg: #fff;
+//** `.list-group-item` border color
+@list-group-border: #ddd;
+//** List group border radius
+@list-group-border-radius: @border-radius-base;
+
+//** Background color of single list items on hover
+@list-group-hover-bg: #f5f5f5;
+//** Text color of active list items
+@list-group-active-color: @component-active-color;
+//** Background color of active list items
+@list-group-active-bg: @component-active-bg;
+//** Border color of active list elements
+@list-group-active-border: @list-group-active-bg;
+//** Text color for content within active list items
+@list-group-active-text-color: lighten(@list-group-active-bg, 40%);
+
+//** Text color of disabled list items
+@list-group-disabled-color: @gray-light;
+//** Background color of disabled list items
+@list-group-disabled-bg: @gray-lighter;
+//** Text color for content within disabled list items
+@list-group-disabled-text-color: @list-group-disabled-color;
+
+@list-group-link-color: #555;
+@list-group-link-hover-color: @list-group-link-color;
+@list-group-link-heading-color: #333;
+
+
+//== Panels
+//
+//##
+
+@panel-bg: #fff;
+@panel-body-padding: 15px;
+@panel-heading-padding: 10px 15px;
+@panel-footer-padding: @panel-heading-padding;
+@panel-border-radius: @border-radius-base;
+
+//** Border color for elements within panels
+@panel-inner-border: #ddd;
+@panel-footer-bg: #f5f5f5;
+
+@panel-default-text: @gray-dark;
+@panel-default-border: #ddd;
+@panel-default-heading-bg: #f5f5f5;
+
+@panel-primary-text: #fff;
+@panel-primary-border: @brand-primary;
+@panel-primary-heading-bg: @brand-primary;
+
+@panel-success-text: @state-success-text;
+@panel-success-border: @state-success-border;
+@panel-success-heading-bg: @state-success-bg;
+
+@panel-info-text: @state-info-text;
+@panel-info-border: @state-info-border;
+@panel-info-heading-bg: @state-info-bg;
+
+@panel-warning-text: @state-warning-text;
+@panel-warning-border: @state-warning-border;
+@panel-warning-heading-bg: @state-warning-bg;
+
+@panel-danger-text: @state-danger-text;
+@panel-danger-border: @state-danger-border;
+@panel-danger-heading-bg: @state-danger-bg;
+
+
+//== Thumbnails
+//
+//##
+
+//** Padding around the thumbnail image
+@thumbnail-padding: 4px;
+//** Thumbnail background color
+@thumbnail-bg: @body-bg;
+//** Thumbnail border color
+@thumbnail-border: #ddd;
+//** Thumbnail border radius
+@thumbnail-border-radius: @border-radius-base;
+
+//** Custom text color for thumbnail captions
+@thumbnail-caption-color: @text-color;
+//** Padding around the thumbnail caption
+@thumbnail-caption-padding: 9px;
+
+
+//== Wells
+//
+//##
+
+@well-bg: #f5f5f5;
+@well-border: darken(@well-bg, 7%);
+
+
+//== Badges
+//
+//##
+
+@badge-color: #fff;
+//** Linked badge text color on hover
+@badge-link-hover-color: #fff;
+@badge-bg: @gray-light;
+
+//** Badge text color in active nav link
+@badge-active-color: @link-color;
+//** Badge background color in active nav link
+@badge-active-bg: #fff;
+
+@badge-font-weight: bold;
+@badge-line-height: 1;
+@badge-border-radius: 10px;
+
+
+//== Breadcrumbs
+//
+//##
+
+@breadcrumb-padding-vertical: 8px;
+@breadcrumb-padding-horizontal: 15px;
+//** Breadcrumb background color
+@breadcrumb-bg: #f5f5f5;
+//** Breadcrumb text color
+@breadcrumb-color: #ccc;
+//** Text color of current page in the breadcrumb
+@breadcrumb-active-color: @gray-light;
+//** Textual separator for between breadcrumb elements
+@breadcrumb-separator: "/";
+
+
+//== Carousel
+//
+//##
+
+@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
+
+@carousel-control-color: #fff;
+@carousel-control-width: 15%;
+@carousel-control-opacity: .5;
+@carousel-control-font-size: 20px;
+
+@carousel-indicator-active-bg: #fff;
+@carousel-indicator-border-color: #fff;
+
+@carousel-caption-color: #fff;
+
+
+//== Close
+//
+//##
+
+@close-font-weight: bold;
+@close-color: #000;
+@close-text-shadow: 0 1px 0 #fff;
+
+
+//== Code
+//
+//##
+
+@code-color: #c7254e;
+@code-bg: #f9f2f4;
+
+@kbd-color: #fff;
+@kbd-bg: #333;
+
+@pre-bg: #f5f5f5;
+@pre-color: @gray-dark;
+@pre-border-color: #ccc;
+@pre-scrollable-max-height: 340px;
+
+
+//== Type
+//
+//##
+
+//** Horizontal offset for forms and lists.
+@component-offset-horizontal: 180px;
+//** Text muted color
+@text-muted: @gray-light;
+//** Abbreviations and acronyms border color
+@abbr-border-color: @gray-light;
+//** Headings small color
+@headings-small-color: @gray-light;
+//** Blockquote small color
+@blockquote-small-color: @gray-light;
+//** Blockquote font size
+@blockquote-font-size: (@font-size-base * 1.25);
+//** Blockquote border color
+@blockquote-border-color: @gray-lighter;
+//** Page header border color
+@page-header-border-color: @gray-lighter;
+//** Width of horizontal description list titles
+@dl-horizontal-offset: @component-offset-horizontal;
+//** Horizontal line color.
+@hr-border: #b2b2b2;
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/buttons.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/buttons.less
new file mode 100644
index 00000000..bbb3c620
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/buttons.less
@@ -0,0 +1,61 @@
+//
+// Buttons
+// --------------------------------------------------
+
+
+// Base styles
+// --------------------------------------------------
+
+// Core styles
+.btn {
+ display: inline-block;
+ padding: 5px 6px 4px 8px;
+ margin-top: 0;
+ margin-bottom: 0; // For input.btn
+ font-family: "Open Sans Condensed", sans-serif;
+ font-size: @font-size-base * 1.3;
+ font-weight: 700;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ line-height: @line-height-computed;
+ text-align: center;
+ vertical-align: middle;
+ touch-action: manipulation;
+ cursor: pointer;
+ background-color: @gray-lighter;
+ background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
+ border: none;
+ border-radius: 3px;
+ .box-shadow(1px 1px 0 rgba(0, 0, 0, 0.3));
+ outline: none !important;
+ white-space: nowrap;
+ .user-select(none);
+
+ &:focus,
+ &.focus {
+ .tab-focus();
+ }
+
+ &:hover,
+ &:focus,
+ &.focus {
+ background-color: lighten(@gray-lighter, 5%);
+ text-decoration: none;
+ .transition(background-color .1s linear);
+ }
+
+ &:active,
+ &.active {
+ outline: 0;
+ padding: 6px 5px 3px 9px;
+ }
+
+ &.disabled,
+ &[disabled],
+ fieldset[disabled] & {
+ cursor: @cursor-disabled;
+ pointer-events: none; // Future-proof disabling of clicks
+ .opacity(65);
+ .box-shadow(1px 1px 0 rgba(0, 0, 0, 0.15));
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/code.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/code.less
new file mode 100644
index 00000000..33af7555
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/code.less
@@ -0,0 +1,8 @@
+code {
+ margin: 0 2px;
+ padding: 1px 5px;
+ border: 1px solid #E1E1E8;
+ background-color: #F7F7F9;
+ color: @gray-dark;
+ font-size: 85%;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/evaluation-form.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/evaluation-form.less
new file mode 100644
index 00000000..6d505d56
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/evaluation-form.less
@@ -0,0 +1,91 @@
+//
+// Evaluation form
+// --------------------------------------------------
+
+
+.evaluation-form {
+ .clearfix();
+
+ textarea {
+ height: 200px;
+ }
+}
+
+.evaluation-input-output {
+ float: left;
+ width: 65%;
+}
+
+.evaluation-input-clear-button {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 15px;
+ height: 15px;
+ margin: 6px;
+ display: inline-block;
+ background: transparent url("../images/clear-text.png") no-repeat scroll 0 0;
+ opacity: 0.75;
+ line-height: 0;
+ vertical-align: bottom;
+ cursor: pointer;
+
+ &:hover {
+ opacity: 1;
+ }
+}
+
+.evaluation-input-clear-button.with-scrollbar {
+ margin-right: 29px;
+}
+
+.evaluation-output {
+ margin-top: 1.5em;
+}
+
+.evaluation-input-field,
+.evaluation-output-field {
+ margin-bottom: 0.5em;
+ .box-sizing(border-box);
+ overflow-x: hidden;
+ line-height: @line-height-computed;
+}
+
+.evaluation-output-field {
+ &[readonly] {
+ cursor: auto;
+ background-color: @input-bg;
+ }
+}
+
+.evaluation-error-header {
+ margin-bottom: @line-height-computed;
+ padding-left: 52px;
+ background: transparent url("../images/icons/48x48/error.png") no-repeat scroll 0 50%;
+ color: @black;
+ font-family: @font-family-sans-serif;
+ font-weight: bold;
+ line-height: 48px;
+ vertical-align: middle;
+}
+
+ul.evaluation-error-list,
+ul.evaluation-warning-list {
+ li {
+ margin-bottom: 1em;
+
+ pre {
+ margin-top: 0.5em;
+ white-space: pre;
+ overflow: auto;
+ }
+ }
+}
+
+ul.evaluation-error-list li pre {
+ background-color: @state-danger-bg;
+}
+
+ul.evaluation-warning-list li pre {
+ background-color: @state-warning-bg;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/forms.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/forms.less
new file mode 100644
index 00000000..2ceb0559
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/forms.less
@@ -0,0 +1,99 @@
+//
+// Forms
+// --------------------------------------------------
+
+// GENERAL STYLES
+// --------------
+
+label {
+ font-weight: normal;
+}
+
+
+// Form controls
+// -------------------------
+
+// Common form controls
+.form-control {
+ line-height: @input-height-base;
+}
+
+.textarea-wrapper {
+ position: relative;
+}
+
+// Form groups
+.form-group {
+ margin-bottom: 0.5em;
+}
+
+// Info and errors
+// --------------------------
+.message-info {
+ border: 1px solid;
+ clear: both;
+ padding: 10px 20px;
+ color: @state-info-text;
+}
+
+.message-error {
+ clear: both;
+ color: @state-danger-text;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin: 20px 0 10px 0;
+}
+
+.message-success {
+ color: @state-success-text;
+ font-size: 1.3em;
+ font-weight: bold;
+ margin: 20px 0 10px 0;
+}
+
+.error {
+ color: @state-danger-text;
+}
+
+// Styles for validation helpers
+// --------------------------
+.validators {
+ font-style: normal;
+ padding-bottom: 0.5em;
+}
+
+.field-validation-error {
+ display: block;
+ padding-bottom: 0.5em;
+ color: @state-danger-text;
+ font-weight: bold;
+}
+
+.field-validation-valid {
+ display: none;
+}
+
+input.input-validation-error,
+textarea.input-validation-error,
+select.input-validation-error
+{
+ border: 1px solid @state-danger-border;
+ background-color: @state-danger-bg;
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
+
+ &:focus {
+ border-color: @state-danger-border;
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@state-danger-text, 20%);
+ .box-shadow(@shadow);
+ }
+}
+
+.validation-summary-errors {
+ color: @state-danger-text;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.validation-summary-valid {
+ display: none;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/icons.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/icons.less
new file mode 100644
index 00000000..4a80f963
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/icons.less
@@ -0,0 +1,36 @@
+//
+// Icons
+// --------------------------------------------------
+
+
+.icon {
+ background: transparent url(../images/icons/32x32/social-media-icons-32.png) no-repeat scroll;
+ display: inline-block;
+ line-height: 0;
+ vertical-align: bottom;
+}
+
+.icon-32 {
+ height: 32px;
+ width: 32px;
+}
+
+.icon-mastodon {
+ background-position: 0 0;
+}
+
+.icon-x {
+ background-position: 0 -32px;
+}
+
+.icon-linkedin {
+ background-position: 0 -64px;
+}
+
+.icon-bluesky {
+ background-position: 0 -96px;
+}
+
+.icon-rss {
+ background-position: 0 -128px;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/layout.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/layout.less
new file mode 100644
index 00000000..35a7f386
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/layout.less
@@ -0,0 +1,128 @@
+html,
+body {
+ margin: 0;
+ height: 100%;
+ /* The html and body elements cannot have any padding or margin */
+}
+
+/* Wrapper for page content to push down footer */
+.l-wrapper {
+ min-height: 100%;
+ height: auto !important;
+ height: 100%;
+ /* Negative indent footer by it's height */
+ margin: 0 auto (-1 * @footer-height);
+}
+
+.l-constrained {
+ margin: 0 auto;
+ padding-left: 20px;
+ padding-right: 20px;
+ max-width: 1200px;
+ min-width: 800px;
+}
+
+.l-header {
+ border-top: solid 10px @black;
+ border-bottom: 1px solid #d4b33a;
+ background-color: #f0db4f;
+
+ .l-constrained {
+ padding-top: 20px;
+ padding-bottom: 20px;
+ .clearfix();
+ }
+}
+
+.l-content {
+ .clearfix();
+}
+
+.l-main-content {
+ float: left;
+ width: 70%;
+}
+
+.l-sidebar {
+ float: right;
+ width: 30%;
+}
+
+/* Set the fixed height of the footer here */
+.l-push,
+.l-footer {
+ height: @footer-height;
+}
+
+.l-footer {
+ width: 100%;
+ background-color: @black;
+ color: @gray-lighter;
+ font-size: @font-size-small;
+ line-height: 100%;
+
+ .l-constrained {
+ padding-top: (@footer-height - 32) / 2;
+ .clearfix();
+ }
+
+ a {
+ color: @gray-lighter;
+ text-decoration: none;
+
+ &:hover,
+ &:active {
+ text-decoration: underline;
+ }
+ }
+}
+
+
+// Header
+// -------------------------
+
+.logo {
+ margin: 0;
+
+ a {
+ display: block;
+ float: left;
+ width: 100px;
+ height: 100px;
+ background: transparent url("../images/jsengineswitcher-logo.png") no-repeat scroll 0 0;
+ text-indent: -9999em;
+ }
+}
+
+.primary-nav {
+ position: relative;
+ left: 40px;
+ float: left;
+}
+
+
+// Footer
+// -------------------------
+
+.l-copyright {
+ float: left;
+ p {
+ margin: 0;
+ padding: 0;
+ }
+}
+
+.l-social {
+ float: right;
+
+ li {
+ display: inline;
+ list-style: none outside none;
+ padding-left: 10px;
+
+ a {
+ text-indent: -9999px;
+ outline: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/mixins.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/mixins.less
new file mode 100644
index 00000000..d26eee79
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/mixins.less
@@ -0,0 +1,9 @@
+//
+// Mixins
+// --------------------------------------------------
+
+// NO Drop shadows
+.no-box-shadow {
+ -webkit-box-shadow: none; // iOS <4.3 & Android <4.1
+ box-shadow: none;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/navbar.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/navbar.less
new file mode 100644
index 00000000..95edf3c2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/navbar.less
@@ -0,0 +1,38 @@
+//
+// Navbars
+// --------------------------------------------------
+
+
+// Wrapper and base class
+//
+// Provide a static navbar from which we expand to create full-width, fixed, and
+// other navbar variations.
+
+.navbar {
+ border: none;
+ border-radius: 0;
+}
+
+// Navbar nav links
+//
+// Builds on top of the `.nav` components with it's own modifier class to make
+// the nav the full height of the horizontal nav (above 768px).
+
+.navbar-nav {
+ float: left;
+ margin: 0 auto;
+
+ > li {
+ > a {
+ float: none;
+ // Vertically center the text given @navbar-height
+ padding: ((@navbar-height - @line-height-computed) / 2) 15px ((@navbar-height - @line-height-computed) / 2);
+ border: 1px solid transparent;
+ font-family: "Open Sans", sans-serif;
+ font-size: 2.0em;
+ text-decoration: none;
+ text-transform: uppercase;
+ outline: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/page-socials.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/page-socials.less
new file mode 100644
index 00000000..ea12dc09
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/page-socials.less
@@ -0,0 +1,14 @@
+.page-socials {
+ min-height: 60px;
+ margin-top: 20px;
+ padding-top: 15px;
+ border-top: 1px solid #b2b2b2;
+}
+
+.share-buttons {
+ li {
+ margin-right: 15px;
+ vertical-align: top;
+ line-height: normal;
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/type.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/type.less
new file mode 100644
index 00000000..02d69502
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/type.less
@@ -0,0 +1,24 @@
+//
+// Typography
+// --------------------------------------------------
+
+// Headings
+// -------------------------
+
+h1, h2, h3 {
+ margin-top: 10px;
+}
+
+h1, h2 {
+ line-height: 40px;
+}
+
+h2 {
+ color: @black;
+ font-weight: bold;
+}
+
+h3 {
+ color: @gray-dark;
+ line-height: @line-height-computed * 1.25;
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/variables.less b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/variables.less
new file mode 100644
index 00000000..498c9796
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot/styles/variables.less
@@ -0,0 +1,7 @@
+// Colors
+// -------------------------
+@black: #1d0d0d;
+
+// Footer
+// -------------------------
+@footer-height: 55px;
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/Helpers/CommonExtensions.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/Helpers/CommonExtensions.cs
new file mode 100644
index 00000000..d58feadb
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/Helpers/CommonExtensions.cs
@@ -0,0 +1,16 @@
+using System.Text.RegularExpressions;
+
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc.Rendering;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+{
+ public static class CommonExtensions
+ {
+ public static HtmlString EncodedReplace(this IHtmlHelper htmlHelper, string input,
+ string pattern, string replacement)
+ {
+ return new HtmlString(Regex.Replace(htmlHelper.Encode(input), pattern, replacement));
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.csproj
new file mode 100644
index 00000000..8ad369ff
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.csproj
@@ -0,0 +1,56 @@
+
+
+
+ JS Engine Switcher: Infrastructure for ASP.NET Core Samples
+ 3.30.2
+ net451;netstandard1.6;netstandard2.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0
+ 1.6.0
+ Library
+ true
+ $(NoWarn);NETSDK1215;NU1902;NU1903;NU1904
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentTagHelper.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentTagHelper.cs
new file mode 100644
index 00000000..22e7e9bb
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentTagHelper.cs
@@ -0,0 +1,78 @@
+using System;
+
+using Microsoft.AspNetCore.Razor.TagHelpers;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+{
+ [HtmlTargetElement("conditional-comment")]
+ public class ConditionalCommentTagHelper : TagHelper
+ {
+ [HtmlAttributeName("type")]
+ public ConditionalCommentType CommentType { get; set; }
+
+ [HtmlAttributeName("expression")]
+ public string Expression { get; set; }
+
+
+ public override void Process(TagHelperContext context, TagHelperOutput output)
+ {
+ output.TagName = null;
+
+ ConditionalCommentType type = CommentType;
+
+ string ifCommentStartPart;
+ string ifCommentEndPart;
+
+ switch (type)
+ {
+ case ConditionalCommentType.Hidden:
+ ifCommentStartPart = "";
+
+ break;
+ case ConditionalCommentType.RevealedValidatingSimplified:
+ ifCommentStartPart = "";
+
+ break;
+ case ConditionalCommentType.Revealed:
+ ifCommentStartPart = "";
+
+ break;
+ default:
+ throw new NotSupportedException();
+ }
+
+ TagHelperContent preContent = output.PreContent;
+ preContent.AppendHtml(ifCommentStartPart);
+ preContent.AppendHtml(Expression);
+ preContent.AppendHtml(ifCommentEndPart);
+
+ string endIfComment;
+
+ switch (type)
+ {
+ case ConditionalCommentType.Hidden:
+ endIfComment = "";
+ break;
+ case ConditionalCommentType.RevealedValidating:
+ case ConditionalCommentType.RevealedValidatingSimplified:
+ endIfComment = "";
+ break;
+ case ConditionalCommentType.Revealed:
+ endIfComment = "";
+ break;
+ default:
+ throw new NotSupportedException();
+ }
+
+ output.PostContent.AppendHtml(endIfComment);
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentType.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentType.cs
new file mode 100644
index 00000000..485194ba
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure/TagHelpers/ConditionalCommentType.cs
@@ -0,0 +1,10 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+{
+ public enum ConditionalCommentType
+ {
+ Hidden,
+ Revealed,
+ RevealedValidating,
+ RevealedValidatingSimplified
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Controllers/HomeController.cs
new file mode 100644
index 00000000..ce25e2d1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Controllers/HomeController.cs
@@ -0,0 +1,80 @@
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IHostingEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ public IActionResult Error()
+ {
+ return View();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1.csproj
new file mode 100644
index 00000000..08c70ce0
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1.csproj
@@ -0,0 +1,55 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 1.0 MVC 1 Site
+ 3.30.2
+ netcoreapp1.0
+ 1.0.16
+ Exe
+ false
+ $(NoWarn);NU1903;NU1904
+ true
+ true
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Program.cs
new file mode 100644
index 00000000..f2bd4508
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Program.cs
@@ -0,0 +1,27 @@
+using System.IO;
+
+using Microsoft.AspNetCore.Hosting;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ string currentDirectory = Directory.GetCurrentDirectory();
+ var host = new WebHostBuilder()
+ .UseKestrel()
+ .UseContentRoot(currentDirectory)
+ .UseWebRoot(Path.Combine(
+ currentDirectory,
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ ))
+ .UseIISIntegration()
+ .UseStartup()
+ .Build()
+ ;
+
+ host.Run();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Properties/launchSettings.json
new file mode 100644
index 00000000..532b02b6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Properties/launchSettings.json
@@ -0,0 +1,27 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:15463/",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "http://localhost:15465/"
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Startup.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Startup.cs
new file mode 100644
index 00000000..4d8735af
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Startup.cs
@@ -0,0 +1,108 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.Vroom;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1
+{
+ public class Startup
+ {
+ ///
+ /// Gets or sets a instance of hosting environment
+ ///
+ public IHostingEnvironment HostingEnvironment
+ {
+ get;
+ set;
+ }
+
+ public IConfigurationRoot Configuration
+ {
+ get;
+ set;
+ }
+
+
+ public Startup(IHostingEnvironment env)
+ {
+ HostingEnvironment = env;
+
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddSingleton(Configuration);
+
+ // Add JavaScriptEngineSwitcher services to the services container.
+ services.AddJsEngineSwitcher(options =>
+ {
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+ })
+ .AddChakraCore()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddVroom()
+ ;
+
+ // Add framework services.
+ services.AddMvc(options =>
+ {
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = HostingEnvironment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+ });
+
+ // Add JavaScriptEngineSwitcher sample services to the services container.
+ services.AddSingleton();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ {
+ loggerFactory.AddConsole(Configuration.GetSection("Logging"));
+ loggerFactory.AddDebug();
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ }
+
+ app.UseStaticFiles();
+
+ app.UseMvc(routes =>
+ {
+ routes.MapRoute(
+ name: "default",
+ template: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..d7f29efe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/Error.cshtml
@@ -0,0 +1,14 @@
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9646764d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..b60019c1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 1.0 MVC 1 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @RenderSection("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..5364be02
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/appsettings.json
new file mode 100644
index 00000000..7124dec4
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/appsettings.json
@@ -0,0 +1,16 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/web.config b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/web.config
new file mode 100644
index 00000000..76e68eea
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/web.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Controllers/HomeController.cs
new file mode 100644
index 00000000..57f376ff
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10.csproj
new file mode 100644
index 00000000..3d8c1ebc
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10.csproj
@@ -0,0 +1,49 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 10.0 MVC 10 Site
+ 3.30.2
+ net10.0
+ enable
+ Exe
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..20cc9827
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Models/ErrorViewModel.cs
@@ -0,0 +1,9 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Program.cs
new file mode 100644
index 00000000..457ccf63
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Program.cs
@@ -0,0 +1,105 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Mvc;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+var builder = WebApplication.CreateBuilder(new WebApplicationOptions() {
+ WebRootPath = Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ )
+});
+var env = builder.Environment;
+var configuration = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables()
+ .Build()
+ ;
+
+#region Configure services
+
+IServiceCollection services = builder.Services;
+
+services.AddSingleton(configuration);
+
+// Add Jering Node.js service to the services container.
+services.AddNodeJS();
+
+// Add JavaScriptEngineSwitcher services to the services container.
+services.AddJsEngineSwitcher(options =>
+{
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+})
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+services.Configure(options =>
+{
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = builder.Environment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+});
+
+// Add framework services.
+services.AddControllersWithViews();
+
+// Add JavaScriptEngineSwitcher sample services to the services container.
+services.AddSingleton();
+
+#endregion
+
+#region Configure the HTTP request pipeline
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseRouting();
+
+app.MapStaticAssets();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}")
+ .WithStaticAssets();
+
+#endregion
+
+app.Run();
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Properties/launchSettings.json
new file mode 100644
index 00000000..2c93180d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Properties/launchSettings.json
@@ -0,0 +1,38 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:61316/",
+ "sslPort": 44396
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "http://localhost:5169"
+ },
+ "https": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "https://localhost:7103;http://localhost:5169"
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..b568b9f2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..62e3d72c
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 10.0 MVC 10 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..dcad619c
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@addTagHelper *, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.json
new file mode 100644
index 00000000..ed44b7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore10.Mvc10/appsettings.json
@@ -0,0 +1,15 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Controllers/HomeController.cs
new file mode 100644
index 00000000..dfd818ad
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Controllers/HomeController.cs
@@ -0,0 +1,80 @@
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IHostingEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ public IActionResult Error()
+ {
+ return View();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1.csproj
new file mode 100644
index 00000000..8d4e9283
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1.csproj
@@ -0,0 +1,54 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 1.0 Full MVC 1 Site
+ 3.30.2
+ net451
+ Exe
+ true
+ $(NoWarn);NU1903;NU1904
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Program.cs
new file mode 100644
index 00000000..56e599bf
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Program.cs
@@ -0,0 +1,27 @@
+using System.IO;
+
+using Microsoft.AspNetCore.Hosting;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ string currentDirectory = Directory.GetCurrentDirectory();
+ var host = new WebHostBuilder()
+ .UseKestrel()
+ .UseContentRoot(currentDirectory)
+ .UseWebRoot(Path.Combine(
+ currentDirectory,
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ ))
+ .UseIISIntegration()
+ .UseStartup()
+ .Build()
+ ;
+
+ host.Run();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Properties/launchSettings.json
new file mode 100644
index 00000000..e823558d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Properties/launchSettings.json
@@ -0,0 +1,27 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:11752/",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Startup.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Startup.cs
new file mode 100644
index 00000000..970f4b07
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Startup.cs
@@ -0,0 +1,116 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.ApplicationParts;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.Vroom;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1
+{
+ public class Startup
+ {
+ ///
+ /// Gets or sets a instance of hosting environment
+ ///
+ public IHostingEnvironment HostingEnvironment
+ {
+ get;
+ set;
+ }
+
+ public IConfigurationRoot Configuration
+ {
+ get;
+ set;
+ }
+
+
+ public Startup(IHostingEnvironment env)
+ {
+ HostingEnvironment = env;
+
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddSingleton(Configuration);
+
+ // Add JavaScriptEngineSwitcher services to the services container.
+ services.AddJsEngineSwitcher(options =>
+ {
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+ })
+ .AddChakraCore()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddVroom()
+ ;
+
+ // Add framework services.
+ var manager = new ApplicationPartManager();
+ manager.ApplicationParts.Add(new AssemblyPart(typeof(Startup).Assembly));
+
+ services.AddSingleton(manager);
+
+ services.AddMvc(options =>
+ {
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = HostingEnvironment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+ });
+
+ // Add JavaScriptEngineSwitcher sample services to the services container.
+ services.AddSingleton();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ {
+ loggerFactory.AddConsole(Configuration.GetSection("Logging"));
+ loggerFactory.AddDebug();
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ }
+
+ app.UseStaticFiles();
+
+ app.UseMvc(routes =>
+ {
+ routes.MapRoute(
+ name: "default",
+ template: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..d7f29efe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/Error.cshtml
@@ -0,0 +1,14 @@
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9646764d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..34baa99f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 1.0 Full MVC 1 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @RenderSection("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..5364be02
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/app.config b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/app.config
new file mode 100644
index 00000000..8e69f952
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/app.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/appsettings.json
new file mode 100644
index 00000000..7124dec4
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/appsettings.json
@@ -0,0 +1,16 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/web.config b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/web.config
new file mode 100644
index 00000000..76e68eea
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/web.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Controllers/HomeController.cs
new file mode 100644
index 00000000..6ed67b43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IHostingEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.csproj
new file mode 100644
index 00000000..620e4ee2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.csproj
@@ -0,0 +1,40 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 2.1 MVC 2.1 Site
+ 3.30.2
+ netcoreapp2.1
+ Exe
+ true
+ $(NoWarn);NU1902;NU1903;NU1904
+ true
+ true
+ true
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..9149c488
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Models/ErrorViewModel.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Program.cs
new file mode 100644
index 00000000..3dcfa5fc
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Program.cs
@@ -0,0 +1,24 @@
+using System.IO;
+
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateWebHostBuilder(args).Build().Run();
+ }
+
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
+ WebHost.CreateDefaultBuilder(args)
+ .UseWebRoot(Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ ))
+ .UseStartup()
+ ;
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Properties/launchSettings.json
new file mode 100644
index 00000000..def3944c
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Properties/launchSettings.json
@@ -0,0 +1,27 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:1972/",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "http://localhost:1973/"
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Startup.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Startup.cs
new file mode 100644
index 00000000..5a5b6be7
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Startup.cs
@@ -0,0 +1,121 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.Vroom;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21
+{
+ public class Startup
+ {
+ ///
+ /// Gets or sets a instance of hosting environment
+ ///
+ public IHostingEnvironment HostingEnvironment
+ {
+ get;
+ set;
+ }
+
+ public IConfigurationRoot Configuration
+ {
+ get;
+ set;
+ }
+
+
+ public Startup(IHostingEnvironment env)
+ {
+ HostingEnvironment = env;
+
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddSingleton(Configuration);
+
+ // Add JavaScriptEngineSwitcher services to the services container.
+ services.AddJsEngineSwitcher(options =>
+ {
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+ })
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddVroom()
+ ;
+
+ services.Configure(options =>
+ {
+ // This lambda determines whether user consent for non-essential cookies is needed for a given request.
+ options.CheckConsentNeeded = context => true;
+ options.MinimumSameSitePolicy = SameSiteMode.None;
+ });
+
+ // Add framework services.
+ services.AddMvc(options =>
+ {
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = HostingEnvironment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+ }).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
+
+ // Add JavaScriptEngineSwitcher sample services to the services container.
+ services.AddSingleton();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ {
+ loggerFactory.AddConsole(Configuration.GetSection("Logging"));
+ loggerFactory.AddDebug();
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ }
+
+ app.UseStaticFiles();
+
+ app.UseMvc(routes =>
+ {
+ routes.MapRoute(
+ name: "default",
+ template: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..1010fafb
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/Error.cshtml
@@ -0,0 +1,25 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..93808b86
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 2.1 MVC 2.1 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @RenderSection("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.Development.json
new file mode 100644
index 00000000..fa8ce71a
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.Development.json
@@ -0,0 +1,10 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.json
new file mode 100644
index 00000000..7124dec4
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore21.Mvc21/appsettings.json
@@ -0,0 +1,16 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Controllers/HomeController.cs
new file mode 100644
index 00000000..5922c698
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.csproj
new file mode 100644
index 00000000..807b01b2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.csproj
@@ -0,0 +1,50 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 3.1 MVC 3.1 Site
+ 3.30.2
+ netcoreapp3.1
+ Exe
+ true
+ true
+ true
+ true
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..c2adb306
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Models/ErrorViewModel.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Program.cs
new file mode 100644
index 00000000..889d2a4b
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Program.cs
@@ -0,0 +1,34 @@
+using System.IO;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateHostBuilder(args).Build().Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder =>
+ {
+ webBuilder.UseWebRoot(Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ ));
+ webBuilder.UseStartup();
+ })
+ .ConfigureLogging((hostingContext, logging) =>
+ {
+ logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
+ logging.AddConsole();
+ logging.AddDebug();
+ })
+ ;
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Properties/launchSettings.json
new file mode 100644
index 00000000..1b7533c8
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Properties/launchSettings.json
@@ -0,0 +1,28 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:55126",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31": {
+ "commandName": "Project",
+ "dotnetRunMessages": "true",
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5138",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Startup.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Startup.cs
new file mode 100644
index 00000000..b90eb827
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Startup.cs
@@ -0,0 +1,126 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31
+{
+ public class Startup
+ {
+ ///
+ /// Gets or sets a instance of hosting environment
+ ///
+ public IWebHostEnvironment HostingEnvironment
+ {
+ get;
+ set;
+ }
+
+ public IConfigurationRoot Configuration
+ {
+ get;
+ set;
+ }
+
+
+ public Startup(IWebHostEnvironment env)
+ {
+ HostingEnvironment = env;
+
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddSingleton(Configuration);
+
+ // Add Jering Node.js service to the services container.
+ services.AddNodeJS();
+
+ // Add JavaScriptEngineSwitcher services to the services container.
+ services.AddJsEngineSwitcher(options =>
+ {
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+ })
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+ services.Configure(options =>
+ {
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = HostingEnvironment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+ });
+
+ // Add framework services.
+ services.AddControllersWithViews();
+
+ // Add JavaScriptEngineSwitcher sample services to the services container.
+ services.AddSingleton();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ }
+
+ app.UseStaticFiles();
+
+ app.UseRouting();
+
+ app.UseEndpoints(endpoints =>
+ {
+ endpoints.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..4442769d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..e9ffc46f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 3.1 MVC 3.1 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @RenderSection("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.Development.json
new file mode 100644
index 00000000..b10423ed
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.Development.json
@@ -0,0 +1,10 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.json
new file mode 100644
index 00000000..81f55403
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore31.Mvc31/appsettings.json
@@ -0,0 +1,17 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Controllers/HomeController.cs
new file mode 100644
index 00000000..30777c5d
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.csproj
new file mode 100644
index 00000000..07820916
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.csproj
@@ -0,0 +1,50 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 5.0 MVC 5 Site
+ 3.30.2
+ net5.0
+ Exe
+ true
+ true
+ true
+ true
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..81e5e7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Models/ErrorViewModel.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Program.cs
new file mode 100644
index 00000000..376442fc
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Program.cs
@@ -0,0 +1,34 @@
+using System.IO;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateHostBuilder(args).Build().Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder =>
+ {
+ webBuilder.UseWebRoot(Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ ));
+ webBuilder.UseStartup();
+ })
+ .ConfigureLogging((hostingContext, logging) =>
+ {
+ logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
+ logging.AddConsole();
+ logging.AddDebug();
+ })
+ ;
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Properties/launchSettings.json
new file mode 100644
index 00000000..7b2ce114
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Properties/launchSettings.json
@@ -0,0 +1,28 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:19282",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5": {
+ "commandName": "Project",
+ "dotnetRunMessages": "true",
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5121",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Startup.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Startup.cs
new file mode 100644
index 00000000..2ef8be36
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Startup.cs
@@ -0,0 +1,126 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5
+{
+ public class Startup
+ {
+ ///
+ /// Gets or sets a instance of hosting environment
+ ///
+ public IWebHostEnvironment HostingEnvironment
+ {
+ get;
+ set;
+ }
+
+ public IConfigurationRoot Configuration
+ {
+ get;
+ set;
+ }
+
+
+ public Startup(IWebHostEnvironment env)
+ {
+ HostingEnvironment = env;
+
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddSingleton(Configuration);
+
+ // Add Jering Node.js service to the services container.
+ services.AddNodeJS();
+
+ // Add JavaScriptEngineSwitcher services to the services container.
+ services.AddJsEngineSwitcher(options =>
+ {
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+ })
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+ services.Configure(options =>
+ {
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = HostingEnvironment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+ });
+
+ // Add framework services.
+ services.AddControllersWithViews();
+
+ // Add JavaScriptEngineSwitcher sample services to the services container.
+ services.AddSingleton();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ }
+
+ app.UseStaticFiles();
+
+ app.UseRouting();
+
+ app.UseEndpoints(endpoints =>
+ {
+ endpoints.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..667a018f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..5fe54776
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 5.0 MVC 5 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.Development.json
new file mode 100644
index 00000000..8983e0fc
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.json
new file mode 100644
index 00000000..85e9db19
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore5.Mvc5/appsettings.json
@@ -0,0 +1,16 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Controllers/HomeController.cs
new file mode 100644
index 00000000..3c8faaeb
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.csproj
new file mode 100644
index 00000000..726386ed
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.csproj
@@ -0,0 +1,51 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 6.0 MVC 6 Site
+ 3.30.2
+ net6.0
+ enable
+ Exe
+ true
+ $(NoWarn);NETSDK1138
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..8bd1a785
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Models/ErrorViewModel.cs
@@ -0,0 +1,9 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Program.cs
new file mode 100644
index 00000000..2e472860
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Program.cs
@@ -0,0 +1,106 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Mvc;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+var builder = WebApplication.CreateBuilder(new WebApplicationOptions()
+{
+ WebRootPath = Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ )
+});
+var env = builder.Environment;
+var configuration = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables()
+ .Build()
+ ;
+
+#region Configure services
+
+IServiceCollection services = builder.Services;
+
+services.AddSingleton(configuration);
+
+// Add Jering Node.js service to the services container.
+services.AddNodeJS();
+
+// Add JavaScriptEngineSwitcher services to the services container.
+services.AddJsEngineSwitcher(options =>
+{
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+})
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+services.Configure(options =>
+{
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = builder.Environment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+});
+
+// Add framework services.
+services.AddControllersWithViews();
+
+// Add JavaScriptEngineSwitcher sample services to the services container.
+services.AddSingleton();
+
+#endregion
+
+#region Configure the HTTP request pipeline
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}"
+);
+
+#endregion
+
+app.Run();
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Properties/launchSettings.json
new file mode 100644
index 00000000..3410f950
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Properties/launchSettings.json
@@ -0,0 +1,28 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:20428",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5090",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..4d1b91ca
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model?.ShowRequestId ?? false)
+{
+
+ Request ID: @Model?.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..b1f433fd
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 6.0 MVC 6 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.json
new file mode 100644
index 00000000..ed44b7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore6.Mvc6/appsettings.json
@@ -0,0 +1,15 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Controllers/HomeController.cs
new file mode 100644
index 00000000..6f6ed28e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.csproj
new file mode 100644
index 00000000..a2750c47
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.csproj
@@ -0,0 +1,51 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 7.0 MVC 7 Site
+ 3.30.2
+ net7.0
+ enable
+ Exe
+ true
+ true
+ true
+ true
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..cf622ba3
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Models/ErrorViewModel.cs
@@ -0,0 +1,9 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Program.cs
new file mode 100644
index 00000000..2e472860
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Program.cs
@@ -0,0 +1,106 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Mvc;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+var builder = WebApplication.CreateBuilder(new WebApplicationOptions()
+{
+ WebRootPath = Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ )
+});
+var env = builder.Environment;
+var configuration = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables()
+ .Build()
+ ;
+
+#region Configure services
+
+IServiceCollection services = builder.Services;
+
+services.AddSingleton(configuration);
+
+// Add Jering Node.js service to the services container.
+services.AddNodeJS();
+
+// Add JavaScriptEngineSwitcher services to the services container.
+services.AddJsEngineSwitcher(options =>
+{
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+})
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+services.Configure(options =>
+{
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = builder.Environment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+});
+
+// Add framework services.
+services.AddControllersWithViews();
+
+// Add JavaScriptEngineSwitcher sample services to the services container.
+services.AddSingleton();
+
+#endregion
+
+#region Configure the HTTP request pipeline
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}"
+);
+
+#endregion
+
+app.Run();
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Properties/launchSettings.json
new file mode 100644
index 00000000..57ebee9a
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Properties/launchSettings.json
@@ -0,0 +1,28 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:32819",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5107",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..1278d006
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..fe014242
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 7.0 MVC 7 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.json
new file mode 100644
index 00000000..ed44b7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore7.Mvc7/appsettings.json
@@ -0,0 +1,15 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Controllers/HomeController.cs
new file mode 100644
index 00000000..0128dc52
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.csproj
new file mode 100644
index 00000000..1845c729
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.csproj
@@ -0,0 +1,49 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 8.0 MVC 8 Site
+ 3.30.2
+ net8.0
+ enable
+ Exe
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..8cf789c5
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Models/ErrorViewModel.cs
@@ -0,0 +1,9 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Program.cs
new file mode 100644
index 00000000..2e472860
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Program.cs
@@ -0,0 +1,106 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Mvc;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+var builder = WebApplication.CreateBuilder(new WebApplicationOptions()
+{
+ WebRootPath = Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ )
+});
+var env = builder.Environment;
+var configuration = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables()
+ .Build()
+ ;
+
+#region Configure services
+
+IServiceCollection services = builder.Services;
+
+services.AddSingleton(configuration);
+
+// Add Jering Node.js service to the services container.
+services.AddNodeJS();
+
+// Add JavaScriptEngineSwitcher services to the services container.
+services.AddJsEngineSwitcher(options =>
+{
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+})
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+services.Configure(options =>
+{
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = builder.Environment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+});
+
+// Add framework services.
+services.AddControllersWithViews();
+
+// Add JavaScriptEngineSwitcher sample services to the services container.
+services.AddSingleton();
+
+#endregion
+
+#region Configure the HTTP request pipeline
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}"
+);
+
+#endregion
+
+app.Run();
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Properties/launchSettings.json
new file mode 100644
index 00000000..dda1c460
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Properties/launchSettings.json
@@ -0,0 +1,29 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:29737",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:5282",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..bfb58107
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..ebe02bba
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 8.0 MVC 8 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..8fe8384e
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
+@addTagHelper "*, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure"
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.json
new file mode 100644
index 00000000..ed44b7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore8.Mvc8/appsettings.json
@@ -0,0 +1,15 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Controllers/HomeController.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Controllers/HomeController.cs
new file mode 100644
index 00000000..57f376ff
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Controllers/HomeController.cs
@@ -0,0 +1,83 @@
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+
+using JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Controllers
+{
+ public class HomeController : Controller
+ {
+ private readonly FileContentService _fileContentService;
+ private readonly JsEvaluationService _jsEvaluationService;
+
+
+ public HomeController(
+ IConfigurationRoot configuration,
+ IWebHostEnvironment hostingEnvironment,
+ JsEvaluationService jsEvaluationService)
+ {
+ string textContentDirectoryPath = configuration
+ .GetSection("jsengineswitcher")
+ .GetSection("Samples")["TextContentDirectoryPath"]
+ ;
+
+ _fileContentService = new FileContentService(textContentDirectoryPath, hostingEnvironment);
+ _jsEvaluationService = jsEvaluationService;
+ }
+
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Index()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("index.html"));
+
+ return View();
+ }
+
+ [HttpGet]
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Demo()
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+
+ return View(model);
+ }
+
+ [HttpPost]
+ public async Task Demo(JsEvaluationViewModel editedModel)
+ {
+ var model = _jsEvaluationService.GetInitializationData();
+ await TryUpdateModelAsync(model, string.Empty, m => m.EngineName, m=> m.Expression);
+
+ if (ModelState.IsValid)
+ {
+ model = _jsEvaluationService.Evaluate(model);
+
+ ModelState.Clear();
+ }
+
+ return View(model);
+ }
+
+ [ResponseCache(CacheProfileName = "CacheCompressedContent5Minutes")]
+ public IActionResult Contact()
+ {
+ ViewBag.Body = new HtmlString(_fileContentService.GetFileContent("contact.html"));
+
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.csproj b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.csproj
new file mode 100644
index 00000000..8f79d123
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.csproj
@@ -0,0 +1,49 @@
+
+
+
+ JS Engine Switcher: Sample ASP.NET Core 9.0 MVC 9 Site
+ 3.30.2
+ net9.0
+ enable
+ Exe
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Models/ErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Models/ErrorViewModel.cs
new file mode 100644
index 00000000..20cc9827
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Models/ErrorViewModel.cs
@@ -0,0 +1,9 @@
+namespace JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models
+{
+ public class ErrorViewModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Program.cs b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Program.cs
new file mode 100644
index 00000000..457ccf63
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Program.cs
@@ -0,0 +1,105 @@
+using Jering.Javascript.NodeJS;
+using Microsoft.AspNetCore.Mvc;
+
+using JavaScriptEngineSwitcher.ChakraCore;
+using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
+using JavaScriptEngineSwitcher.Jint;
+using JavaScriptEngineSwitcher.Jurassic;
+using JavaScriptEngineSwitcher.Msie;
+using JavaScriptEngineSwitcher.NiL;
+using JavaScriptEngineSwitcher.Node;
+using JavaScriptEngineSwitcher.Sample.Logic.Services;
+using JavaScriptEngineSwitcher.V8;
+using JavaScriptEngineSwitcher.Vroom;
+using JavaScriptEngineSwitcher.Yantra;
+
+var builder = WebApplication.CreateBuilder(new WebApplicationOptions() {
+ WebRootPath = Path.Combine(
+ Directory.GetCurrentDirectory(),
+ "../JavaScriptEngineSwitcher.Sample.AspNetCore.ClientSideAssets/wwwroot"
+ )
+});
+var env = builder.Environment;
+var configuration = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables()
+ .Build()
+ ;
+
+#region Configure services
+
+IServiceCollection services = builder.Services;
+
+services.AddSingleton(configuration);
+
+// Add Jering Node.js service to the services container.
+services.AddNodeJS();
+
+// Add JavaScriptEngineSwitcher services to the services container.
+services.AddJsEngineSwitcher(options =>
+{
+ options.AllowCurrentProperty = false;
+ options.DefaultEngineName = ChakraCoreJsEngine.EngineName;
+})
+ .AddChakraCore()
+ .AddJint()
+ .AddJurassic()
+ .AddMsie(options =>
+ {
+ options.EngineMode = JsEngineMode.ChakraIeJsRt;
+ })
+ .AddNiL()
+ .AddNode(services)
+ .AddV8()
+ .AddVroom()
+ .AddYantra()
+ ;
+
+services.Configure(options =>
+{
+ options.CacheProfiles.Add("CacheCompressedContent5Minutes",
+ new CacheProfile
+ {
+ NoStore = builder.Environment.IsDevelopment(),
+ Duration = 300,
+ Location = ResponseCacheLocation.Client,
+ VaryByHeader = "Accept-Encoding"
+ }
+ );
+});
+
+// Add framework services.
+services.AddControllersWithViews();
+
+// Add JavaScriptEngineSwitcher sample services to the services container.
+services.AddSingleton();
+
+#endregion
+
+#region Configure the HTTP request pipeline
+
+var app = builder.Build();
+
+if (app.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseRouting();
+
+app.MapStaticAssets();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}")
+ .WithStaticAssets();
+
+#endregion
+
+app.Run();
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Properties/launchSettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Properties/launchSettings.json
new file mode 100644
index 00000000..a94e92ed
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Properties/launchSettings.json
@@ -0,0 +1,38 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:53687/",
+ "sslPort": 44308
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "http://localhost:5220"
+ },
+ "https": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "https://localhost:7242;http://localhost:5220"
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Contact.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Contact.cshtml
new file mode 100644
index 00000000..58785ebe
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Contact.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = "Contact";
+}
+
+
+ @ViewBag.Title
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Demo.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Demo.cshtml
new file mode 100644
index 00000000..befb8f43
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Demo.cshtml
@@ -0,0 +1,67 @@
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+@using JavaScriptEngineSwitcher.Sample.Resources
+
+@model JsEvaluationViewModel
+
+@{
+ ViewBag.Title = "Demo";
+}
+
+@ViewBag.Title
+
+
+
+@section Scripts {
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Index.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Index.cshtml
new file mode 100644
index 00000000..a9c2cfb1
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Home/Index.cshtml
@@ -0,0 +1,8 @@
+@{
+ ViewBag.Title = string.Empty;
+}
+
+
+ Project Description
+ @ViewBag.Body
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/Error.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/Error.cshtml
new file mode 100644
index 00000000..b568b9f2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/Error.cshtml
@@ -0,0 +1,28 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9.Models
+
+@model ErrorViewModel
+
+@{
+ ViewData["Title"] = "Error";
+}
+
+Error.
+An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID: @Model.RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_JsEvaluationErrorList.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_JsEvaluationErrorList.cshtml
new file mode 100644
index 00000000..9e0601d6
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_JsEvaluationErrorList.cshtml
@@ -0,0 +1,23 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.Helpers
+@using JavaScriptEngineSwitcher.Sample.Logic.Models
+
+@model IList
+
+Found @Model.Count error(s):
+
+ @foreach (var error in Model)
+ {
+ -
+ @error.EngineFullName
+ @if (error.LineNumber > 0)
+ {
+ Line @error.LineNumber, Column @error.ColumnNumber
+ }
+ @Html.EncodedReplace(@error.Message, "\n\r?", "
")
+ @if (!string.IsNullOrWhiteSpace(error.SourceFragment))
+ {
+ @error.SourceFragment
+ }
+
+ }
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_Layout.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..b595497f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/Shared/_Layout.cshtml
@@ -0,0 +1,107 @@
+@using JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure.TagHelpers
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(ViewBag.Title)) {@ViewBag.Title | }JavaScriptEngineSwitcher Sample ASP.NET Core 9.0 MVC 9 Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaScript Engine Switcher
+
+
+
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @await RenderSectionAsync("scripts", required: false)
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewImports.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewImports.cshtml
new file mode 100644
index 00000000..dcad619c
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@addTagHelper *, JavaScriptEngineSwitcher.Sample.AspNetCore.Infrastructure
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewStart.cshtml b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..817a9134
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.Development.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.json b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.json
new file mode 100644
index 00000000..ed44b7ae
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.AspNetCore9.Mvc9/appsettings.json
@@ -0,0 +1,15 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*",
+
+ "JsEngineSwitcher": {
+ "Samples": {
+ "TextContentDirectoryPath": "../SharedData/text-content"
+ }
+ }
+}
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/JavaScriptEngineSwitcher.Sample.Logic.csproj b/samples/JavaScriptEngineSwitcher.Sample.Logic/JavaScriptEngineSwitcher.Sample.Logic.csproj
new file mode 100644
index 00000000..9112f74a
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/JavaScriptEngineSwitcher.Sample.Logic.csproj
@@ -0,0 +1,68 @@
+
+
+
+ JS Engine Switcher: Logic for Samples
+ 3.30.2
+ net40;net451;net471;netstandard1.6;netstandard2.0;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0
+ 1.6.0
+ Library
+ true
+ $(NoWarn);NETSDK1215;NU1902;NU1903;NU1904
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationErrorViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationErrorViewModel.cs
new file mode 100644
index 00000000..98f627e2
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationErrorViewModel.cs
@@ -0,0 +1,98 @@
+namespace JavaScriptEngineSwitcher.Sample.Logic.Models
+{
+ ///
+ /// JS evaluation error view model
+ ///
+ public sealed class JsEvaluationErrorViewModel
+ {
+ ///
+ /// Gets or sets a name of JS engine
+ ///
+ public string EngineName
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a version of original JS engine
+ ///
+ public string EngineVersion
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets a full name of JS engine
+ ///
+ public string EngineFullName
+ {
+ get
+ {
+ string engineFullName = EngineName + " ";
+ if (EngineVersion.Contains(".") || EngineVersion.Contains(","))
+ {
+ engineFullName += "version ";
+ if (EngineVersion.Contains(","))
+ {
+ engineFullName += "of ";
+ }
+ }
+ engineFullName += EngineVersion;
+
+ return engineFullName;
+ }
+ }
+
+ ///
+ /// Gets or sets a message
+ ///
+ public string Message
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a line number
+ ///
+ public int LineNumber
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a column number
+ ///
+ public int ColumnNumber
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a source fragment
+ ///
+ public string SourceFragment
+ {
+ get;
+ set;
+ }
+
+
+ ///
+ /// Constructs an instance of JS evaluation error view model
+ ///
+ public JsEvaluationErrorViewModel()
+ {
+ EngineName = string.Empty;
+ EngineVersion = string.Empty;
+ Message = string.Empty;
+ LineNumber = 0;
+ ColumnNumber = 0;
+ SourceFragment = string.Empty;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationResultViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationResultViewModel.cs
new file mode 100644
index 00000000..5ffc63ca
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationResultViewModel.cs
@@ -0,0 +1,43 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+using JavaScriptEngineSwitcher.Sample.Resources;
+
+namespace JavaScriptEngineSwitcher.Sample.Logic.Models
+{
+ ///
+ /// JS evaluation result view model
+ ///
+ public sealed class JsEvaluationResultViewModel
+ {
+ ///
+ /// Gets or sets a result value
+ ///
+ [Display(Name = "DisplayName_ResultValue", ResourceType = typeof(EvaluationStrings))]
+ [DataType(DataType.MultilineText)]
+ public string Value
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a list of errors
+ ///
+ public IList Errors
+ {
+ get;
+ set;
+ }
+
+
+ ///
+ /// Constructs an instance of JS evaluation result view model
+ ///
+ public JsEvaluationResultViewModel()
+ {
+ Value = string.Empty;
+ Errors = new List();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationViewModel.cs b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationViewModel.cs
new file mode 100644
index 00000000..0cca3971
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/Models/JsEvaluationViewModel.cs
@@ -0,0 +1,73 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+#if NET451_OR_GREATER || NETSTANDARD || NETCOREAPP
+using Microsoft.AspNetCore.Mvc.Rendering;
+#elif NET40
+using System.Web.Mvc;
+#else
+#error No implementation for this target
+#endif
+
+using JavaScriptEngineSwitcher.Sample.Resources;
+
+namespace JavaScriptEngineSwitcher.Sample.Logic.Models
+{
+ ///
+ /// JS evaluation view model
+ ///
+ public sealed class JsEvaluationViewModel
+ {
+ ///
+ /// Gets or sets a name of JS engine
+ ///
+ [Display(Name = "DisplayName_EngineName", ResourceType = typeof(EvaluationStrings))]
+ public string EngineName
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a list of available JS engines
+ ///
+ public IEnumerable AvailableEngineList
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a expression
+ ///
+ [Display(Name = "DisplayName_Expression", ResourceType = typeof(EvaluationStrings))]
+ [DataType(DataType.MultilineText)]
+ [Required(ErrorMessageResourceName = "ErrorMessage_FormFieldIsNotFilled", ErrorMessageResourceType = typeof(EvaluationStrings))]
+ [StringLength(1000000, ErrorMessageResourceName = "ErrorMessage_FormFieldValueTooLong", ErrorMessageResourceType = typeof(EvaluationStrings))]
+ public string Expression
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets a result of evaluation
+ ///
+ public JsEvaluationResultViewModel Result
+ {
+ get;
+ set;
+ }
+
+
+ ///
+ /// Constructs an instance of JS evaluation view model
+ ///
+ public JsEvaluationViewModel()
+ {
+ EngineName = string.Empty;
+ AvailableEngineList = new List();
+ Expression = string.Empty;
+ Result = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/FileContentService.cs b/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/FileContentService.cs
new file mode 100644
index 00000000..de909780
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/FileContentService.cs
@@ -0,0 +1,97 @@
+using System;
+using System.IO;
+#if NET451_OR_GREATER || NETSTANDARD
+using HostingEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
+#elif NETCOREAPP3_1_OR_GREATER
+using HostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment;
+#elif NET40
+using System.Web;
+#else
+#error No implementation for this target
+#endif
+
+using JavaScriptEngineSwitcher.Sample.Resources;
+
+namespace JavaScriptEngineSwitcher.Sample.Logic.Services
+{
+ public sealed class FileContentService
+ {
+ private readonly string _textContentDirectoryPath;
+#if NET451_OR_GREATER || NETSTANDARD || NETCOREAPP
+ private readonly HostingEnvironment _hostingEnvironment;
+#endif
+
+
+#if NET451_OR_GREATER || NETSTANDARD || NETCOREAPP
+ public FileContentService(
+ string textContentDirectoryPath,
+ HostingEnvironment hostingEnvironment
+ )
+ {
+ _textContentDirectoryPath = textContentDirectoryPath;
+ _hostingEnvironment = hostingEnvironment;
+ }
+#elif NET40
+ public FileContentService(string textContentDirectoryPath)
+ {
+ _textContentDirectoryPath = textContentDirectoryPath;
+ }
+#else
+#error No implementation for this target
+#endif
+
+ public string GetFileContent(string filePath)
+ {
+ if (string.IsNullOrWhiteSpace(filePath))
+ {
+ throw new ArgumentException(
+ string.Format(CommonStrings.ErrorMessage_FilePathNotSpecified, filePath),
+ "filePath"
+ );
+ }
+
+ string content;
+ string fullFilePath = _textContentDirectoryPath.TrimEnd('/') + "/" + filePath;
+ string physicalFilePath = GetPhysicalFilePath(fullFilePath);
+
+ try
+ {
+ using (FileStream fileStream = File.OpenRead(physicalFilePath))
+ using (var reader = new StreamReader(fileStream))
+ {
+ content = reader.ReadToEnd();
+ }
+ }
+ catch (FileNotFoundException)
+ {
+ throw new FileNotFoundException(
+ string.Format(CommonStrings.ErrorMessage_FileNotFound, filePath));
+ }
+ catch (DirectoryNotFoundException)
+ {
+ throw new FileNotFoundException(
+ string.Format(CommonStrings.ErrorMessage_FileNotFound, filePath));
+ }
+
+ return content;
+ }
+
+ private string GetPhysicalFilePath(string filePath)
+ {
+#if NET451_OR_GREATER || NETSTANDARD || NETCOREAPP
+ string applicationDirectoryPath = _hostingEnvironment.ContentRootPath;
+#elif NET40
+ HttpContext context = HttpContext.Current;
+ string applicationDirectoryPath = context.Server.MapPath("~/");
+#else
+#error No implementation for this target
+#endif
+ string physicalFilePath = Path.Combine(
+ applicationDirectoryPath,
+ filePath.Replace('/', '\\').TrimStart(new char[] { '\\' })
+ );
+
+ return physicalFilePath;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/JsEvaluationService.cs b/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/JsEvaluationService.cs
new file mode 100644
index 00000000..2317ac51
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Logic/Services/JsEvaluationService.cs
@@ -0,0 +1,135 @@
+using System.Collections.Generic;
+using System.Linq;
+#if NET451_OR_GREATER || NETSTANDARD || NETCOREAPP
+using Microsoft.AspNetCore.Mvc.Rendering;
+#elif NET40
+using System.Web.Mvc;
+#else
+#error No implementation for this target
+#endif
+
+using JavaScriptEngineSwitcher.Core;
+
+using JavaScriptEngineSwitcher.Sample.Logic.Models;
+
+namespace JavaScriptEngineSwitcher.Sample.Logic.Services
+{
+ public class JsEvaluationService
+ {
+ private static readonly Dictionary _engineDisplayNameMappings;
+
+ private readonly IJsEngineSwitcher _engineSwitcher;
+
+
+ static JsEvaluationService()
+ {
+ _engineDisplayNameMappings = new Dictionary
+ {
+ { "MsieJsEngine", "MSIE" }
+ };
+ }
+
+#if NET40
+ public JsEvaluationService()
+ : this(JsEngineSwitcher.Current)
+ { }
+
+#endif
+ public JsEvaluationService(IJsEngineSwitcher engineSwitcher)
+ {
+ _engineSwitcher = engineSwitcher;
+ }
+
+
+ public JsEvaluationViewModel GetInitializationData()
+ {
+ var model = new JsEvaluationViewModel
+ {
+ EngineName = _engineSwitcher.DefaultEngineName,
+ AvailableEngineList = _engineSwitcher.EngineFactories
+ .Select(e => new SelectListItem
+ {
+ Value = e.EngineName,
+ Text = GetEngineDisplayName(e.EngineName)
+ }),
+ Expression = string.Empty,
+ Result = null
+ };
+
+ return model;
+ }
+
+ public JsEvaluationViewModel Evaluate(JsEvaluationViewModel model)
+ {
+ IJsEngine engine = null;
+ var result = new JsEvaluationResultViewModel();
+
+ try
+ {
+ engine = _engineSwitcher.CreateEngine(model.EngineName);
+ result.Value = engine.Evaluate(model.Expression);
+ }
+ catch (JsScriptException e)
+ {
+ var error = GetJsEvaluationErrorFromException(e);
+ error.LineNumber = e.LineNumber;
+ error.ColumnNumber = e.ColumnNumber;
+ error.SourceFragment = e.SourceFragment;
+
+ result.Errors.Add(error);
+ }
+ catch (JsException e)
+ {
+ var error = GetJsEvaluationErrorFromException(e);
+ result.Errors.Add(error);
+ }
+ finally
+ {
+ if (engine != null)
+ {
+ engine.Dispose();
+ }
+ }
+
+ model.Result = result;
+
+ return model;
+ }
+
+ private static JsEvaluationErrorViewModel GetJsEvaluationErrorFromException(JsException jsException)
+ {
+ var jsError = new JsEvaluationErrorViewModel
+ {
+ EngineName = GetEngineDisplayName(jsException.EngineName),
+ EngineVersion = jsException.EngineVersion,
+ Message = jsException.Message
+ };
+
+ return jsError;
+ }
+
+ private static string GetEngineDisplayName(string engineName)
+ {
+ string displayName = engineName;
+ const string postfix = "JsEngine";
+
+ if (_engineDisplayNameMappings.ContainsKey(engineName))
+ {
+ displayName = _engineDisplayNameMappings[engineName];
+ }
+ else
+ {
+ if (engineName.EndsWith(postfix))
+ {
+ int displayNameLength = engineName.Length - postfix.Length;
+ if (displayNameLength > 0)
+ {
+ displayName = engineName.Substring(0, displayNameLength);
+ }
+ }
+ }
+
+ return displayName;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.Designer.cs b/samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.Designer.cs
new file mode 100644
index 00000000..3e6c3446
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.Designer.cs
@@ -0,0 +1,91 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+namespace JavaScriptEngineSwitcher.Sample.Resources
+{
+ using System;
+ using System.Globalization;
+ using System.Reflection;
+ using System.Resources;
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ public class CommonStrings
+ {
+ private static Lazy _resourceManager =
+ new Lazy(() => new ResourceManager(
+ "JavaScriptEngineSwitcher.Sample.Resources.CommonStrings",
+#if NET20 || NET30 || NET35 || NET40
+ typeof(CommonStrings).Assembly
+#else
+ typeof(CommonStrings).GetTypeInfo().Assembly
+#endif
+ ));
+
+ private static CultureInfo _resourceCulture;
+
+ ///
+ /// Returns a cached ResourceManager instance used by this class
+ ///
+ public static ResourceManager ResourceManager
+ {
+ get
+ {
+ return _resourceManager.Value;
+ }
+ }
+
+ ///
+ /// Overrides a current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class
+ ///
+ public static CultureInfo Culture
+ {
+ get
+ {
+ return _resourceCulture;
+ }
+ set
+ {
+ _resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to "File '{0}' not exist."
+ ///
+ public static string ErrorMessage_FileNotFound
+ {
+ get { return GetString("ErrorMessage_FileNotFound"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "File path not specified."
+ ///
+ public static string ErrorMessage_FilePathNotSpecified
+ {
+ get { return GetString("ErrorMessage_FilePathNotSpecified"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "During reading of the file '{0}' an unknown error has occurred."
+ ///
+ public static string ErrorMessage_FileReadingFailed
+ {
+ get { return GetString("ErrorMessage_FileReadingFailed"); }
+ }
+
+ private static string GetString(string name)
+ {
+ string value = ResourceManager.GetString(name, _resourceCulture);
+
+ return value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.Jint/Resources/Strings.resx b/samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.resx
similarity index 93%
rename from src/JavaScriptEngineSwitcher.Jint/Resources/Strings.resx
rename to samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.resx
index 3a141333..3d9148ac 100644
--- a/src/JavaScriptEngineSwitcher.Jint/Resources/Strings.resx
+++ b/samples/JavaScriptEngineSwitcher.Sample.Resources/CommonStrings.resx
@@ -117,13 +117,13 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Maximum execution time exceeded.
+
+ File '{0}' not exist.
-
- Recursion is forbidden by script host: {0}
+
+ File path not specified.
-
- Maximum number of statements executed have been reached.
+
+ During reading of the file '{0}' an unknown error has occurred.
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.Designer.cs b/samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.Designer.cs
new file mode 100644
index 00000000..14fa940f
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.Designer.cs
@@ -0,0 +1,115 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+namespace JavaScriptEngineSwitcher.Sample.Resources
+{
+ using System;
+ using System.Globalization;
+ using System.Reflection;
+ using System.Resources;
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ public class EvaluationStrings
+ {
+ private static Lazy _resourceManager =
+ new Lazy(() => new ResourceManager(
+ "JavaScriptEngineSwitcher.Sample.Resources.EvaluationStrings",
+#if NET20 || NET30 || NET35 || NET40
+ typeof(EvaluationStrings).Assembly
+#else
+ typeof(EvaluationStrings).GetTypeInfo().Assembly
+#endif
+ ));
+
+ private static CultureInfo _resourceCulture;
+
+ ///
+ /// Returns a cached ResourceManager instance used by this class
+ ///
+ public static ResourceManager ResourceManager
+ {
+ get
+ {
+ return _resourceManager.Value;
+ }
+ }
+
+ ///
+ /// Overrides a current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class
+ ///
+ public static CultureInfo Culture
+ {
+ get
+ {
+ return _resourceCulture;
+ }
+ set
+ {
+ _resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to "Evaluate"
+ ///
+ public static string ButtonText_Evaluate
+ {
+ get { return GetString("ButtonText_Evaluate"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "Engine"
+ ///
+ public static string DisplayName_EngineName
+ {
+ get { return GetString("DisplayName_EngineName"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "Expression"
+ ///
+ public static string DisplayName_Expression
+ {
+ get { return GetString("DisplayName_Expression"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "Result"
+ ///
+ public static string DisplayName_ResultValue
+ {
+ get { return GetString("DisplayName_ResultValue"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "You did not fill field "{0}"."
+ ///
+ public static string ErrorMessage_FormFieldIsNotFilled
+ {
+ get { return GetString("ErrorMessage_FormFieldIsNotFilled"); }
+ }
+
+ ///
+ /// Looks up a localized string similar to "The field "{0}" must be a string with a maximum length of {1:N0}."
+ ///
+ public static string ErrorMessage_FormFieldValueTooLong
+ {
+ get { return GetString("ErrorMessage_FormFieldValueTooLong"); }
+ }
+
+ private static string GetString(string name)
+ {
+ string value = ResourceManager.GetString(name, _resourceCulture);
+
+ return value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.V8/Resources/Strings.ru-ru.resx b/samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.resx
similarity index 89%
rename from src/JavaScriptEngineSwitcher.V8/Resources/Strings.ru-ru.resx
rename to samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.resx
index 1a4c523d..1b24a4f2 100644
--- a/src/JavaScriptEngineSwitcher.V8/Resources/Strings.ru-ru.resx
+++ b/samples/JavaScriptEngineSwitcher.Sample.Resources/EvaluationStrings.resx
@@ -117,13 +117,22 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Не удалось загрузить значение `undefined` для ClearScript!
+
+ Evaluate
-
- Не удалось загрузить сборку ClearScriptV8, потому что директория "{0}" не существует.
+
+ Engine
-
- Не удалось загрузить сборку ClearScriptV8, потому что файл "{0}" не существует.
+
+ Expression
+
+
+ Result
+
+
+ You did not fill field "{0}".
+
+
+ The field "{0}" must be a string with a maximum length of {1:N0}.
\ No newline at end of file
diff --git a/samples/JavaScriptEngineSwitcher.Sample.Resources/JavaScriptEngineSwitcher.Sample.Resources.csproj b/samples/JavaScriptEngineSwitcher.Sample.Resources/JavaScriptEngineSwitcher.Sample.Resources.csproj
new file mode 100644
index 00000000..21b8c5cb
--- /dev/null
+++ b/samples/JavaScriptEngineSwitcher.Sample.Resources/JavaScriptEngineSwitcher.Sample.Resources.csproj
@@ -0,0 +1,27 @@
+
+
+
+ JS Engine Switcher: Resources for Samples
+ 3.30.2
+ net40-client;net45;net471;netstandard1.3;netstandard2.0
+ 1.6.0
+ Library
+ true
+ $(NoWarn);NETSDK1215;NU1903
+ false
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/SharedData/text-content/contact.html b/samples/SharedData/text-content/contact.html
new file mode 100644
index 00000000..7b72dd94
--- /dev/null
+++ b/samples/SharedData/text-content/contact.html
@@ -0,0 +1,13 @@
+JavaScript Engine Switcher is an open source project, created and maintained by Andrey Taritsyn.
+
+Project Site
+https://github.com/Taritsyn/JavaScriptEngineSwitcher
+
+Email
+
+
+Personal Site
+
+
+Mastodon
+
\ No newline at end of file
diff --git a/samples/SharedData/text-content/index.html b/samples/SharedData/text-content/index.html
new file mode 100644
index 00000000..3f876a89
--- /dev/null
+++ b/samples/SharedData/text-content/index.html
@@ -0,0 +1,2 @@
+JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines (ChakraCore, Jint, Jurassic, MSIE JavaScript Engine for .NET, NiL.JS, Jering.Javascript.NodeJS, Microsoft ClearScript.V8, VroomJs and YantraJS). This library allows you to quickly and easily switch to using of another JavaScript engine.
+JavaScript Engine Switcher was created and is maintained by Andrey Taritsyn.
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.csproj
new file mode 100644
index 00000000..40c96426
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for Linux (x64)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for Linux (x64).
+ $(PackageCommonTags);ChakraCore;Linux;x64
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.nuspec
new file mode 100644
index 00000000..d5a1567f
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64.nuspec
@@ -0,0 +1,11 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..202c0c2b
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/PACKAGE-DESCRIPTION.md
@@ -0,0 +1,3 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for Linux (x64).
+
+This package is only compatible with .NET Core.
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/readme.txt
new file mode 100644
index 00000000..fd2f8f3c
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64/readme.txt
@@ -0,0 +1,29 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for Linux x64 v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for Linux (x64).
+
+ This package is only compatible with .NET Core.
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.csproj
new file mode 100644
index 00000000..16d5be07
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for OS X (x64)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for OS X (x64).
+ $(PackageCommonTags);ChakraCore;macOS;OSX;x64
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.nuspec
new file mode 100644
index 00000000..a9105540
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.nuspec
@@ -0,0 +1,11 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..910cd8d8
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/PACKAGE-DESCRIPTION.md
@@ -0,0 +1,3 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for OS X (x64).
+
+This package is only compatible with .NET Core.
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/readme.txt
new file mode 100644
index 00000000..2b84ec5b
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64/readme.txt
@@ -0,0 +1,29 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for OS X x64 v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for OS X (x64).
+
+ This package is only compatible with .NET Core.
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.csproj
new file mode 100644
index 00000000..4c281d94
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for Windows (ARM)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for Windows (ARM).
+ $(PackageCommonTags);ChakraCore;Windows;ARM
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.nuspec
new file mode 100644
index 00000000..bd55ce3c
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.nuspec
@@ -0,0 +1,14 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..0e15d877
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/PACKAGE-DESCRIPTION.md
@@ -0,0 +1,3 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for Windows (ARM).
+
+This package is only compatible with .NET Core and .NET Framework 4.5.
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.props b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.props
new file mode 100644
index 00000000..bedb5851
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm.props
@@ -0,0 +1,16 @@
+
+
+
+
+ arm/%(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
+ %(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/readme.txt
new file mode 100644
index 00000000..5f8ec868
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/readme.txt
@@ -0,0 +1,29 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for Windows ARM v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for Windows (ARM).
+
+ This package is only compatible with .NET Core and .NET Framework 4.5.
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Install.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Install.ps1
new file mode 100644
index 00000000..9cbe0573
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Install.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+
+ $assemblyDestDir = Join-Path $projectDir 'bin/arm'
+ if (!(Test-Path $assemblyDestDir)) {
+ New-Item -ItemType Directory -Force -Path $assemblyDestDir
+ }
+
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-arm/native/*.*'
+ Copy-Item $assemblySourceFiles $assemblyDestDir -Force
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Uninstall.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Uninstall.ps1
new file mode 100644
index 00000000..fe5bab11
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm/tools/Uninstall.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-arm/native/*.*'
+
+ foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
+ $assemblyFile = Join-Path $projectDir "bin/arm/$($assemblySourceFileInfo.Name)"
+ if (Test-Path $assemblyFile) {
+ Remove-Item $assemblyFile -Force
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.csproj
new file mode 100644
index 00000000..8e1d3262
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for Windows (ARM64)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for Windows (ARM64).
+ $(PackageCommonTags);ChakraCore;Windows;ARM64
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.nuspec
new file mode 100644
index 00000000..be7a9192
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.nuspec
@@ -0,0 +1,14 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..70ef2878
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/PACKAGE-DESCRIPTION.md
@@ -0,0 +1,3 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for Windows (ARM64).
+
+This package is only compatible with .NET Core and .NET Framework 4.5.
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.props b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.props
new file mode 100644
index 00000000..f783db92
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64.props
@@ -0,0 +1,16 @@
+
+
+
+
+ arm64/%(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
+ %(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/readme.txt
new file mode 100644
index 00000000..d6809f35
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/readme.txt
@@ -0,0 +1,29 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for Windows ARM64 v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for Windows (ARM64).
+
+ This package is only compatible with .NET Core and .NET Framework 4.5.
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Install.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Install.ps1
new file mode 100644
index 00000000..b16c3f75
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Install.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+
+ $assemblyDestDir = Join-Path $projectDir 'bin/arm64'
+ if (!(Test-Path $assemblyDestDir)) {
+ New-Item -ItemType Directory -Force -Path $assemblyDestDir
+ }
+
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-arm64/native/*.*'
+ Copy-Item $assemblySourceFiles $assemblyDestDir -Force
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Uninstall.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Uninstall.ps1
new file mode 100644
index 00000000..f1fa4b6c
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-arm64/tools/Uninstall.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-arm64/native/*.*'
+
+ foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
+ $assemblyFile = Join-Path $projectDir "bin/arm64/$($assemblySourceFileInfo.Name)"
+ if (Test-Path $assemblyFile) {
+ Remove-Item $assemblyFile -Force
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.csproj
new file mode 100644
index 00000000..26562fe9
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for Windows (x64)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for Windows (x64).
+ $(PackageCommonTags);ChakraCore;Windows;x64
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.nuspec
new file mode 100644
index 00000000..dd6618a8
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.nuspec
@@ -0,0 +1,14 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..0cd8c83c
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/PACKAGE-DESCRIPTION.md
@@ -0,0 +1 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for Windows (x64).
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.props b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.props
new file mode 100644
index 00000000..5a187768
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64.props
@@ -0,0 +1,16 @@
+
+
+
+
+ x64/%(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
+ %(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/readme.txt
new file mode 100644
index 00000000..6ac75fb7
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/readme.txt
@@ -0,0 +1,27 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for Windows x64 v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for Windows (x64).
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Install.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Install.ps1
new file mode 100644
index 00000000..f44b2b4e
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Install.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+
+ $assemblyDestDir = Join-Path $projectDir 'bin/x64'
+ if (!(Test-Path $assemblyDestDir)) {
+ New-Item -ItemType Directory -Force -Path $assemblyDestDir
+ }
+
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-x64/native/*.*'
+ Copy-Item $assemblySourceFiles $assemblyDestDir -Force
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Uninstall.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Uninstall.ps1
new file mode 100644
index 00000000..6443ab60
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x64/tools/Uninstall.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-x64/native/*.*'
+
+ foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
+ $assemblyFile = Join-Path $projectDir "bin/x64/$($assemblySourceFileInfo.Name)"
+ if (Test-Path $assemblyFile) {
+ Remove-Item $assemblyFile -Force
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.csproj b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.csproj
new file mode 100644
index 00000000..b90cd8f5
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.csproj
@@ -0,0 +1,21 @@
+
+
+
+ JS Engine Switcher: ChakraCore for Windows (x86)
+ 3.27.3
+ netstandard2.0
+
+
+
+
+
+
+
+ https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ ../../Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and contains the native implementation of ChakraCore for Windows (x86).
+ $(PackageCommonTags);ChakraCore;Windows;x86
+ ChakraCore was updated to version of August 1, 2024.
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.nuspec b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.nuspec
new file mode 100644
index 00000000..8b0bc5e3
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.nuspec
@@ -0,0 +1,14 @@
+
+
+
+ $CommonMetadataElements$
+
+
+ $CommonFileElements$
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/PACKAGE-DESCRIPTION.md b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/PACKAGE-DESCRIPTION.md
new file mode 100644
index 00000000..b6951ff8
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/PACKAGE-DESCRIPTION.md
@@ -0,0 +1 @@
+This package complements the [JavaScriptEngineSwitcher.ChakraCore](https://www.nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore) package and contains the native implementation of [ChakraCore](https://github.com/chakra-core/ChakraCore) version of August 1, 2024 for Windows (x86).
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.props b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.props
new file mode 100644
index 00000000..be3fd380
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/build/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86.props
@@ -0,0 +1,16 @@
+
+
+
+
+ x86/%(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
+ %(Filename)%(Extension)
+ PreserveNewest
+ False
+
+
+
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/readme.txt b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/readme.txt
new file mode 100644
index 00000000..ff0c8d12
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/readme.txt
@@ -0,0 +1,27 @@
+
+
+ --------------------------------------------------------------------------------
+ README file for JS Engine Switcher: ChakraCore for Windows x86 v3.27.3
+
+ --------------------------------------------------------------------------------
+
+ Copyright (c) 2013-2024 Andrey Taritsyn - http://www.taritsyn.ru
+
+
+ ===========
+ DESCRIPTION
+ ===========
+ This package complements the JavaScriptEngineSwitcher.ChakraCore package and
+ contains the native implementation of ChakraCore version of August 1, 2024
+ for Windows (x86).
+
+ =============
+ RELEASE NOTES
+ =============
+ ChakraCore was updated to version of August 1, 2024.
+
+ =============
+ DOCUMENTATION
+ =============
+ See documentation on GitHub -
+ http://github.com/Taritsyn/JavaScriptEngineSwitcher
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Install.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Install.ps1
new file mode 100644
index 00000000..4a9e29e9
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Install.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+
+ $assemblyDestDir = Join-Path $projectDir 'bin/x86'
+ if (!(Test-Path $assemblyDestDir)) {
+ New-Item -ItemType Directory -Force -Path $assemblyDestDir
+ }
+
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-x86/native/*.*'
+ Copy-Item $assemblySourceFiles $assemblyDestDir -Force
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Uninstall.ps1 b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Uninstall.ps1
new file mode 100644
index 00000000..6402ab1d
--- /dev/null
+++ b/src/JavaScriptEngineSwitcher.ChakraCore.Native.win-x86/tools/Uninstall.ps1
@@ -0,0 +1,13 @@
+param($installPath, $toolsPath, $package, $project)
+
+if ($project.Type -eq 'Web Site') {
+ $projectDir = $project.Properties.Item('FullPath').Value
+ $assemblySourceFiles = Join-Path $installPath 'runtimes/win-x86/native/*.*'
+
+ foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
+ $assemblyFile = Join-Path $projectDir "bin/x86/$($assemblySourceFileInfo.Name)"
+ if (Test-Path $assemblyFile) {
+ Remove-Item $assemblyFile -Force
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs b/src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs
index 2ba9a4e8..721caa7a 100644
--- a/src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs
+++ b/src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs
@@ -1,67 +1,66 @@
-namespace JavaScriptEngineSwitcher.ChakraCore
-{
- using System;
- using System.IO;
- using System.Runtime.InteropServices;
- using System.Text.RegularExpressions;
+#if NETFRAMEWORK
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+#if NET40
+
+using PolyfillsForOldDotNet.System.Runtime.InteropServices;
+#endif
+
+using JavaScriptEngineSwitcher.Core.Utilities;
- using Resources;
+using JavaScriptEngineSwitcher.ChakraCore.Constants;
+using JavaScriptEngineSwitcher.ChakraCore.Resources;
+namespace JavaScriptEngineSwitcher.ChakraCore
+{
///
/// Assembly resolver
///
internal static class AssemblyResolver
{
- ///
- /// Name of directory, that contains the ChakraCore assemblies
- ///
- private const string ASSEMBLY_DIRECTORY_NAME = "ChakraCore";
-
- ///
- /// Regular expression for working with the `bin` directory path
- ///
- private static readonly Regex _binDirectoryRegex = new Regex(@"\\bin\\?$", RegexOptions.IgnoreCase);
-
-
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [DllImport("kernel32.dll", SetLastError = true)]
private static extern bool SetDllDirectory(string lpPathName);
+
///
/// Initialize a assembly resolver
///
public static void Initialize()
{
- var currentDomain = AppDomain.CurrentDomain;
- string platform = Environment.Is64BitProcess ? "x64" : "x86";
-
- string binDirectoryPath = currentDomain.SetupInformation.PrivateBinPath;
- if (string.IsNullOrEmpty(binDirectoryPath))
+ AppDomain currentDomain = AppDomain.CurrentDomain;
+ string baseDirectoryPath = currentDomain.SetupInformation.PrivateBinPath;
+ if (string.IsNullOrEmpty(baseDirectoryPath))
{
// `PrivateBinPath` property is empty in test scenarios, so
// need to use the `BaseDirectory` property
- binDirectoryPath = currentDomain.BaseDirectory;
+ baseDirectoryPath = currentDomain.BaseDirectory;
}
- string assemblyDirectoryPath = Path.Combine(binDirectoryPath, ASSEMBLY_DIRECTORY_NAME, platform);
+ Architecture architecture = RuntimeInformation.OSArchitecture;
+ string platform;
- if (!Directory.Exists(assemblyDirectoryPath))
+ if (architecture == Architecture.X64 || architecture == Architecture.X86)
+ {
+ platform = Utils.Is64BitProcess() ? "x64" : "x86";
+ }
+ else if (architecture == Architecture.Arm64 || architecture == Architecture.Arm)
{
- if (_binDirectoryRegex.IsMatch(binDirectoryPath))
- {
- string applicationRootPath = _binDirectoryRegex.Replace(binDirectoryPath, string.Empty);
- assemblyDirectoryPath = Path.Combine(applicationRootPath, ASSEMBLY_DIRECTORY_NAME, platform);
+ platform = Utils.Is64BitProcess() ? "arm64" : "arm";
+ }
+ else
+ {
+ return;
+ }
- if (!Directory.Exists(assemblyDirectoryPath))
- {
- throw new DirectoryNotFoundException(
- string.Format(Strings.Engines_ChakraCoreAssemblyDirectoryNotFound, assemblyDirectoryPath));
- }
- }
- else
- {
- throw new DirectoryNotFoundException(
- string.Format(Strings.Engines_ChakraCoreAssemblyDirectoryNotFound, assemblyDirectoryPath));
- }
+ string assemblyFileName = DllName.ForWindows;
+ string assemblyDirectoryPath = Path.Combine(baseDirectoryPath, platform);
+ string assemblyFilePath = Path.Combine(assemblyDirectoryPath, assemblyFileName);
+ bool assemblyFileExists = File.Exists(assemblyFilePath);
+
+ if (!assemblyFileExists)
+ {
+ return;
}
if (!SetDllDirectory(assemblyDirectoryPath))
@@ -71,4 +70,5 @@ public static void Initialize()
}
}
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs b/src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs
index f927e68f..9a545b96 100644
--- a/src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs
+++ b/src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs
@@ -1,912 +1,881 @@
-namespace JavaScriptEngineSwitcher.ChakraCore
+using System;
+#if NET45_OR_GREATER || NETSTANDARD
+using System.Runtime.InteropServices;
+#endif
+using System.Text;
+
+using AdvancedStringBuilder;
+#if NET40
+using PolyfillsForOldDotNet.System.Runtime.InteropServices;
+#endif
+
+using JavaScriptEngineSwitcher.Core;
+using JavaScriptEngineSwitcher.Core.Constants;
+using JavaScriptEngineSwitcher.Core.Extensions;
+using JavaScriptEngineSwitcher.Core.Utilities;
+
+using ErrorLocationItem = JavaScriptEngineSwitcher.Core.Helpers.ErrorLocationItem;
+using CoreErrorHelpers = JavaScriptEngineSwitcher.Core.Helpers.JsErrorHelpers;
+using CoreStrings = JavaScriptEngineSwitcher.Core.Resources.Strings;
+using TextHelpers = JavaScriptEngineSwitcher.Core.Helpers.TextHelpers;
+using WrapperCompilationException = JavaScriptEngineSwitcher.Core.JsCompilationException;
+using WrapperEngineException = JavaScriptEngineSwitcher.Core.JsEngineException;
+using WrapperEngineLoadException = JavaScriptEngineSwitcher.Core.JsEngineLoadException;
+using WrapperException = JavaScriptEngineSwitcher.Core.JsException;
+using WrapperFatalException = JavaScriptEngineSwitcher.Core.JsFatalException;
+using WrapperInterruptedException = JavaScriptEngineSwitcher.Core.JsInterruptedException;
+using WrapperRuntimeException = JavaScriptEngineSwitcher.Core.JsRuntimeException;
+using WrapperScriptException = JavaScriptEngineSwitcher.Core.JsScriptException;
+using WrapperUsageException = JavaScriptEngineSwitcher.Core.JsUsageException;
+
+using JavaScriptEngineSwitcher.ChakraCore.Constants;
+using JavaScriptEngineSwitcher.ChakraCore.JsRt;
+using JavaScriptEngineSwitcher.ChakraCore.Resources;
+
+using OriginalEngineException = JavaScriptEngineSwitcher.ChakraCore.JsRt.JsEngineException;
+using OriginalException = JavaScriptEngineSwitcher.ChakraCore.JsRt.JsException;
+using OriginalFatalException = JavaScriptEngineSwitcher.ChakraCore.JsRt.JsFatalException;
+using OriginalScriptException = JavaScriptEngineSwitcher.ChakraCore.JsRt.JsScriptException;
+using OriginalUsageException = JavaScriptEngineSwitcher.ChakraCore.JsRt.JsUsageException;
+
+namespace JavaScriptEngineSwitcher.ChakraCore
{
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Reflection;
- using System.Runtime.InteropServices;
-
- using OriginalJsException = JsRt.JsException;
-
- using Core;
- using Core.Utilities;
- using CoreStrings = Core.Resources.Strings;
-
- using Helpers;
- using JsRt;
- using Resources;
-
///
- /// Adapter for ChakraCore JavaScript engine
+ /// Adapter for the ChakraCore JS engine
///
public sealed class ChakraCoreJsEngine : JsEngineBase
{
///
- /// Name of JavaScript engine
+ /// Name of JS engine
///
- private const string ENGINE_NAME = "ChakraCore JavaScript engine";
+ public const string EngineName = "ChakraCoreJsEngine";
///
- /// Version of original JavaScript engine
+ /// Version of original JS engine
///
- private const string ENGINE_VERSION = "May 24, 2016";
+ private const string EngineVersion = "Aug 1, 2024";
///
- /// Instance of JavaScript runtime
+ /// Instance of JS runtime
///
private JsRuntime _jsRuntime;
///
- /// Instance of JavaScript context
+ /// Instance of JS context
///
- private readonly JsContext _jsContext;
+ private JsContext _jsContext;
///
- /// Synchronizer of code execution
+ /// JS source context
///
- private readonly object _executionSynchronizer = new object();
+ private JsSourceContext _jsSourceContext = JsSourceContext.FromIntPtr(IntPtr.Zero);
///
- /// List of external objects
+ /// Type mapper
///
- private readonly ISet