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.

72 questions
0
votes
0 answers

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 usable dot net playground (for example…
Vanquished Wombat
  • 9,075
  • 5
  • 28
  • 67
0
votes
0 answers

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 throwing this error as well. Perhaps the full…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
0
votes
0 answers

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 of save button.
Sam
  • 11
  • 1
0
votes
1 answer

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 they were int's I could just use... foreach (int i in…
Vanquished Wombat
  • 9,075
  • 5
  • 28
  • 67
0
votes
1 answer

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 type arguments --- Script error details follow --- …
0
votes
1 answer

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 HostTypeCollection(); foreach (var assembly in new…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
0
votes
0 answers

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); ... JSE.AddHostObject("CSHost", new HostFunctions()); …
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
0
votes
2 answers

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). We evaluate those functions using ClearScript…
eddiewould
  • 1,555
  • 16
  • 36
0
votes
2 answers

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 occurred during the execution of the current web…
0
votes
1 answer

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(System.String)); engine.ExecuteCommand("test =…
0
votes
1 answer

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 calculations - I'd rather avoid having to change those…
eddiewould
  • 1,555
  • 16
  • 36
0
votes
1 answer

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 (Javascript): var form =…
slavayancheg
  • 59
  • 2
  • 12
0
votes
1 answer

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" }, { language: 'fr', message: "valeur incorrecte" …
pdube
  • 593
  • 1
  • 11
  • 26
0
votes
1 answer

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 sure the V8ScriptEngine instances created with…
robbie
  • 1,219
  • 1
  • 11
  • 25
0
votes
1 answer

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 the error is this: Comparing the assembly name…
NicoRiff
  • 4,803
  • 3
  • 25
  • 54