Questions tagged [clearscript]
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.
67
questions
0
votes
1
answer
59
views
Could not load file or assembly 'ClearScriptV8.win-x64.dll' or one of its dependencies. The module was expected to contain an assembly manifest
I have .NET MVC app (.NET Framework 4.6.1) and I want to add ClearScript to my app.
I've added package Microsoft.ClearScript via NuGet and after launch app I have error:
Could not load file or ...
0
votes
1
answer
21
views
Clearscript V8: how to tell if 32 or 64 bit V8 engine was used?
I have an issue where certain clients report bugs from code called from js.
One they I want to check is if this maybe is because of 32 vs 64 bit engine. How can I tell which was used? Is that ...
0
votes
1
answer
76
views
Unity + ClearScript - Importing DLL
I'm trying to use ClearScript in Unity, but fail because Unity does not see the DLL.
To be sure, I cloned the project and had the DLLs built. I did this using the instructions from ClearScript.
The ...
1
vote
1
answer
66
views
Is it possible to use ClearScript on Mac M1?
OS: Mac M1
Framework: .Net 6.0
IDE: Rider
NuGet packages:
Microsoft.ClearScript (v7.2.1)
Microsoft.ClearScript.V8 (v7.2.1)
My simple JavaScript REPL:
using Microsoft.ClearScript.V8;
using myConsole =...
0
votes
0
answers
110
views
ClearScript + Node.JS
So straight to the point:
I've been wondering ever since I found this awesome project if there could be a way to integrate basic node.js modules in it, like 'fs'/'path'/'sys'/...
I'm even keen to ...
0
votes
1
answer
103
views
How to set Typescript target lib?
Hi I'm using the clearscript V8 engine and want to enable TypeScript.
Following this post I'm able to load the https://rawgit.com/Microsoft/TypeScript/master/lib/typescriptServices.js javascript code ...
2
votes
1
answer
290
views
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 ...
0
votes
0
answers
224
views
DotNetFiddle or similar for ClearScript
[I realise this is slighly off-topic for SO but I am asking this as I want to raise a couple of questions around ClearScript and I want to be able to include fiddles to make life easier.]
Is there a ...
2
votes
1
answer
816
views
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 ...
0
votes
0
answers
206
views
In a non-UI application, how do I handle "The calling thread cannot access this object because a different thread owns it"
I've read through the discussion at The calling thread cannot access this object because a different thread owns it but it's all about UI.
I have two C# EXEs that are purely command-line, but are ...
1
vote
1
answer
91
views
Does Microsoft's ClearScript has any editor?
Does Microsoft's ClearScript has any editor to create VbScripts or JScripts?
0
votes
0
answers
207
views
Using Microsoft ClearScript i want to execute C#/VbScript from the java script. and how to execute dynamic C#/Vb code in ClearScript
Using Microsoft ClearScript i want to execute C#/VbScript from the java script. and how to execute dynamic C#/Vb code in ClearScript.
I need to execute vbscript/C# code from javascript after click ...
0
votes
1
answer
307
views
Iterate through JS object passed as parameter to host function into a dictionary
How do can I convert to a dictionary of name & value pairs from a JS object passed into a host C# method ? My problem is how to interpret the 'object's that are received at the exec function. If ...
0
votes
1
answer
91
views
Get System.Type instance from within script (ClearScript)
I'm getting an exception when trying to call Enum.Parse from within a script hosted via ClearScript
Error
Error: The non-generic method 'System.Enum.Parse(System.Type, string)' cannot be used with ...
1
vote
1
answer
137
views
Attempting to create V8ScriptEngine instance fails with IExpando error
I am trying to create an instance of V8ScriptEngine but am getting an exception as below:
using Microsoft.ClearScript.V8;
V8ScriptEngine engine = new V8ScriptEngine();
Exception: "Could not load ...
1
vote
1
answer
388
views
How can I run untrusted javascript in clearscript?
I'm looking at Clearscript for running my javascript code in my c# program.
I intend to use its V8 implementation, as implementing my own build of V8 is not possible right now (MSVC build is broken, ...
1
vote
0
answers
378
views
C# MS ClearScript Add dynamic host objects
I have a collection which I am exposing to a clearscript engine, at the moment I have to specify that the Value property is a static type int so that scripting basic arithmetic as plus or minus will ...
1
vote
0
answers
106
views
Having exposed System.Data.DataTable into JS via ClearScript how do I express its objects for TypeScript?
So I have an amped up JavaScript scripting environment in my application provided by ClearScript.
It dawned on me that I could use TypeScript to write hopefully better code and for the most part ...
1
vote
1
answer
33
views
C# MS ClearView access a property directly by another property's value
I am making a scripting program using MS ClearScript.
I would like to be able to reference to a property indirectly without having to type out the value member of my class.
Here is my class:
...
0
votes
1
answer
335
views
How do I update a column in a System.Data datarow using V8 under ClearScript?
I'm using the V8ScriptEngine
v8 = new V8ScriptEngine(V8ScriptEngineFlags.DisableGlobalMembers);
and have exposed the "System.Data" namespace into the ClearScript environment.
var htc = new ...
0
votes
0
answers
77
views
ClearScript ExtendedHostFunctions kills EXE when run from Task Scheduler?
In my C# project I have the following
private static JScriptEngine JSE = new JScriptEngine(WindowsScriptEngineFlags.EnableDebugging | WindowsScriptEngineFlags.EnableJITDebugging);
...
...
1
vote
0
answers
71
views
Use TypeScript to develop 3rd party JS scripts
We use ClearScript to extend our apps, exporting C# objects into the JavaScript environment.
We'd like to use TypeScript to help develop these extending modules. These modules end in .RR for the ...
2
votes
2
answers
247
views
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 ...
1
vote
1
answer
370
views
How to extend C# types with MS ClearScript?
I have a few classes (to be precise, there are about 70-100 classes in my project) written in C#. Those classes are converted to Javascript (I have added V8 Javacript MS ClearScript Engine to my ...
0
votes
2
answers
680
views
Interacting with the Chrome V8 debugger protocol through .NET (ClearScript)
I'm maintaining an enterprise C# application that provides end-user extensibility through user-defined JavaScript functions (with a select few C# types/proxies exposed) (think financial algorithms).
...
2
votes
2
answers
813
views
C#.Net ClearsScript V8 enable modules
Is there a way to enable "import <module>.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 ...
1
vote
1
answer
556
views
How to load jquery file in c# code using V8ScriptEngine (Clearscript)?
I am trying to execute javascript function from c# code using ClearScript(V8ScriptEngine). Here Script_Text is javascript code. I want to call api from jquery and load Execute function in C#.I got ...
0
votes
1
answer
1k
views
Could not load file or assembly 'ClearScriptV8-32.DLL' or one of its dependencies. The specified module could not be found
Server Error in '/' Application.
Could not load file or assembly 'ClearScriptV8-32.DLL' or one of its dependencies. The specified module could not be found.
Description: An unhandled exception ...
2
votes
1
answer
808
views
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 ...
1
vote
1
answer
100
views
Process Debug Manager (PDM) security issues
I have an issue with all computers in AD:
I'm getting this error after creating VBScriptEngine with debugging flag:
either a required impersonation level was not provided, or the provided ...
0
votes
1
answer
72
views
ScriptengineException when string methods are called
When I am using the following snippet, I get a ScrptEngineException, that the object does not support the Property or Method.
var engine = new JScriptEngine();
engine.AddHostType("String", typeof(...
1
vote
1
answer
1k
views
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 ...
1
vote
1
answer
692
views
Using ClearScript inside Threads
I have a C# application where I spawn multiple threads. I'm on .NET framework 4.7.1. Inside these threads, work is performed and this work may execute user-defined scripted functions. I am using ...
0
votes
1
answer
589
views
How to convert native JS array of CLR types to CLR array with Clearscript
I'm looking at converting our application from using JavaScript.NET (Noesis) to use ClearScript.
Our app contains a large number of user-created Javascript algorithms/expressions for financial ...
0
votes
1
answer
440
views
ClearsSript V8ScriptEngine TypeError: form.Show is not a function
I use MS ClearScript library for some dynamic parts in my system. I have some list of objects that already created in .NET(C#) code, this objects use as description for functions use. Like this (...
1
vote
1
answer
328
views
ClearScript: Stop converting methods to JavaScript properties
_Engine.Script.test( new { test = 123, cat = "lolcat" } );
This outputs the following to JavaScript:
{"Equals":{},"GetHashCode":{},"ToString":{},"GetType":{},"test":123,"cat":"lolcat"}
As you can ...
0
votes
1
answer
642
views
ClearScript: how to get object values
I have ClearScript that can do either
error = "value is invalid";
or
error = [
{
language: 'en',
message: "value is invalid"
},
{
...
-1
votes
1
answer
226
views
How does v8ScriptEngine infer the scripting language
Just curious, Just started using V8ScriptEngine,
I have this code fragment
private void button1_Click(object sender, EventArgs e)
{
string f = "function myFunc(x) {if(x >= ...
1
vote
1
answer
499
views
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 ...
1
vote
1
answer
3k
views
Cannot load assembly or dependencies with ClearScript.V8
I am started a project with ClearScript.V8.
I am developing on Windows 10 & Visual Studio 2015 in C#. The web is IISExpress and this will eventually be released on a Windows 2012 server.
I added ...
0
votes
1
answer
124
views
Are V8ScriptEngine instances disposed when the parent V8Runtime is disposed?
Are V8ScriptEngine instances disposed when the parent V8Runtime is disposed?
The documentation for the library isn't clear on this. I've implemented a partial CommonJS environment, but I want to make ...
2
votes
1
answer
174
views
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 ...
0
votes
1
answer
305
views
Assembly error when running as service
I'm getting an assembly error when I run my application as service. This doesn't happen whenever I launch the project directly from Visual Studio. Below is the complete error message. It seems that ...
-1
votes
1
answer
708
views
How to invoke method of dynamic object using reflection
I've got dynamic object which contains some execute function generated by V8ScriptEngine. I need to execute this method with parameters which was specified in Dictionary object. I tried this approach:
...
4
votes
1
answer
465
views
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 ...
0
votes
1
answer
195
views
How to expose HtmlAgilityPack.CssSelectors into ClearScript
Context: Azure, C#, ClearScript, JavaScript, HtmlAgilityPack, HtmlAgilityPack.CssSelectors
I do this a lot: add scripting to C# apps using ClearScript. Ordinarily this just works.
...
using ...
1
vote
1
answer
539
views
How do I serialize compiled V8Script in Clearscript?
I am using ClearScript to compile some JavaScript and then I would like to serialize it to store it in SQL. But it is marked as not Serializable, what should I do?
V8ScriptEngine engine = new ...
1
vote
1
answer
536
views
How to update a Dictionary entry in ClearScript?
Context: ClearScript, JScript, C#, Windows, Azure
In my ClearScript-enabled projects, I have a Dictionary<string,object> that I use for passing data into, around inside and back out of ...
0
votes
1
answer
764
views
In Selenium, moving to an (x,y) on browser screen doesn't move mouse pointer. Why?
Context: Windows 10; C# .NET; Selenium WebDriver (Chrome); ClearScript
I've exposed a number of Selenium functions to a javascript via ClearScript. In the script ...
var url = "http://www.google.com....
0
votes
0
answers
1k
views
Clearscript V8 in ASP.NET 5 - v8-x64.dll could not be opened -- PE image doesn't contain managed metadata
I have issues with ClearScript. When I use them from regular project (class library or wpf), when dependency is added through nuget, also a post build script is added that copies ClearScriptV8-32.dll, ...