Monday, January 21, 2019

Microsoft Clear Script

Previously I have been using Microsoft Clear Script to add scripting capability to my .NET program.
Recently I upgraded to google V8 engine. If you are not familiar with ClearScript you can visit
https://github.com/Microsoft/ClearScript to take a look.

With V8 Engine the execution of javascript is pretty fast with some memories overhead.

Previously building V8 engine is really pain and not for faint heart.
Current is comes with NuGet Package. Just open Visual Studio 2015 or 2017, then search for clearscript.
 It should pop up then you can download it using NuGet.You need to save the project. It is just a few DLL files. Just use any project name will do.

After download just go to your user profile directory, default should be c:\users\%username%\.
Just do a search with "ClearScript" you should be able to locate the folder.  or you can search v8-x64.dll
all the dll files should be in the same folder. right click and open file location. copy all the DLL in the v8 folder, go back to on level above go to /lib and /net45 you will need to copy clearscript.dll and the xml also

put all those dll and xml file into /bin folder.

on ASP. NET please add below
system.web>
  <compilation>
    <assemblies>
      <remove assembly="ClearScriptV8-64" />
      <remove assembly="ClearScriptV8-32" />
    </assemblies>
  </compilation>
</system.web>
 Important: If Visual Studio is not installed on your deployment machine, you must install 32-bit and 64-bit Visual C++ Redistributable packages:
Visual C++ Redistributable for Visual Studio 2017 [x64] [x86]