ClearScript is a library that makes it easy to add scripting to your .NET applications. It currently supports JavaScript (via V8 and JScript) and VBScript.
Questions tagged [clearscript]
72 questions
22
votes
7 answers
Clearscript files cannot be found on host
Like a lot of others I'm receiving the following error when deploying my ASP.Net MVC application:
Cannot load V8 interface assembly; verify that the following files are installed with your application: ClearScriptV8-32.dll, ClearScriptV8-64.dll,…

Levon
- 574
- 1
- 3
- 14
8
votes
3 answers
Loading the TypeScript compiler into ClearScript, "WScript is undefined", impossible task?
I tried using ClearScript to load the TypeScript compiler in order to compile some basic TypeScript code.
Unfortunately, when executing the TypeScript compiler source I get this error:
'WScript' is undefined
This is the LINQPad program I've used,…

Lasse V. Karlsen
- 380,855
- 102
- 628
- 825
6
votes
5 answers
Missing ClearScriptV8-64.dll, v8-ia32.dll, v8-x64.dll in C# ConsoleApp
I want to run a simple clearscript program.
For this i created a new ConsoleProject and added the reference via nuget.
When creating the Engine (first line of code)
using (var engine = new V8ScriptEngine())
i get
System.TypeLoadException was…

Boas Enkler
- 12,264
- 16
- 69
- 143
5
votes
3 answers
How to create a C# class (according to an existing class) dynamically at runtime
Background:
We have a project with client side(Javascript) and server side(C#). There is a calculation logic need to run in both sides, so it is written in both Javascript and C#.
We have many unit tests for the C# version classes. Our goal is to…

Zach
- 5,715
- 12
- 47
- 62
4
votes
1 answer
Clearscript Javascript 'require' functionality
I am attempting to write a C# wrapper for the Twilio Programmable Chat tool. The library provided is for JS clients. I thought that using a tool like ClearScript (V8) would allow me to wrap the js as needed.
The example code on the site is
const…

Jeff
- 2,061
- 4
- 27
- 45
4
votes
1 answer
How do you add a profile specification to a FirefoxDriverService in C# Selenium?
Context: Azure, C#, ClearScript, Selenium, Firefox
I'm exposing Selenium's Firefox symbols into a ClearScript JavaScript environment. In the following JavaScript code, the symbols exposed/exported from C# are prefixed with CS.
//…

bugmagnet
- 7,631
- 8
- 69
- 131
3
votes
1 answer
error upon installation of clearscript via nuget in azure web role project
steps to reproduce:
a.run this line in PM console:
Install-Package ClearScript.V8
b.run the application
c.receive this error:
Could not load file or assembly 'ClearScriptV8-32.DLL' or one of its
dependencies. The specified module could not be…

CodeToad
- 4,656
- 6
- 41
- 53
2
votes
1 answer
How to use observablehq/plot from .NET 5 app?
Our team intends to use JavaScript library observablehq/plot from an app written in C# and running on .NET 5. As a proof of concept, we were able to successfully use that library running in a separate process on Node.js. The downside of this…

Vladimir Reshetnikov
- 11,750
- 4
- 30
- 51
2
votes
2 answers
How to define items to be ignored in Typescript
I have an application which uses ClearScript to add JavaScript as an extension language. I've started using Typescript in other projects and thought I'd use it in this one as well.
My problem is that I have exposed quite a number of C#…

bugmagnet
- 7,631
- 8
- 69
- 131
2
votes
2 answers
C#.Net ClearsScript V8 enable modules
Is there a way to enable "import .js;" statements in an embedded V8 Runtime using Microsoft ClearScript?
I couldn't find any examples and makes me think I'd have to parse the script file myself first to enable this.

fasih.rana
- 1,645
- 1
- 14
- 27
2
votes
1 answer
ReferenceError:XMLHttpRequest is not defined while using ClearScript(V8ScriptEngine)
I am calling Execute method of javascript function from C# using V8ScriptEngine but i got error ReferenceError: XMLHttpRequest is not defined.I installed nuget packages like Xhook but not able to resolve.Please help me to reolve this or suggest way…

ramesh santha
- 45
- 3
2
votes
1 answer
How can you pass a JavaScript array to the host with ClearScript?
I am trying to pass a JavaScript array to a host function, but can find no documentation on how to do this using ClearScript. I would have expected it to be this simple, but it's not.
public class myHostType
{
public static void print(string…

Chris_F
- 4,991
- 5
- 33
- 63
2
votes
1 answer
How do I catch an update event in ClearScript.V8?
Is there a way I can instantiate a Javascript variable (using ClearScript.V8) and catch the updates in C# so I can update the value in database?
It works when I use an object, like this:
public class SmartBoolean : ISmartVariable
{
private…

pdube
- 593
- 1
- 11
- 26
2
votes
1 answer
Overloading operators in ClearScript
I'm trying to utilize custom operators for arithmetic on custom classes in my application, which is interfaced to with ClearScript. Below is a snippet of my example custom class:
public class Vector3 {
public float x { get; set; }
public…

Patrick Bell
- 769
- 3
- 15
2
votes
3 answers
Passing variables to Javascript using ClearScript
I want to run Javascript within C# and pass variables between C# and Javascript.
It seems ClearScript is the current stable way to do this.
I have a JavaScript function that looks something like this:
var b = a[0];
var c = a[1];
var d = a[2];
var e…

Be Kind To New Users
- 9,672
- 13
- 78
- 125