Quantcast
Channel: ClearScript
Viewing all 2297 articles
Browse latest View live

New Post: Instantiating V8Runtime with V8RuntimeConstraints crashes

$
0
0
Hi slyngel,

It looks like V8 now expects those constraints to be expressed in mebibytes, so try setting those properties to 24 instead of 24x1024x1024.

In general we no longer recommend that you use V8RuntimeConstraints unless your application has a Chrome-like multi-process architecture that withstands process crashes. You can find more information here.

We'll update the documentation in the next point release.

Thanks!

New Post: Instantiating V8Runtime with V8RuntimeConstraints crashes

$
0
0
Thanks for the info! Awesome answer. Keep up the great work!

New Post: Is ClearScript supported for store apps?

$
0
0
Thanks for quick response. It is helpful.

New Post: Building clearscript with VS2012

$
0
0
Hi, I have been using 5.3 and want to upgrade to latest version. I am not able to build the latest source code with VS2012.

My dev environment is not yet updated to VS2013 and I still use VS2012. Is there a way to build 5.4 with VS2012?

regards
satyendra pandey

New Post: Building clearscript with VS2012

New Post: Provide Pre-Built Download?

New Post: Azure Mobile Services Cannot Load V8 Interface Assembly

$
0
0
Got same problem on IIS 8.5.
  1. It is working on local IIS 7.5 (Windows 7)
  2. Before I put AssemblyResolve code I got an Exception from "at Microsoft.ClearScript.V8.V8Proxy.LoadAssembly()" and for ClearScriptV8, that sound like LoadNativeLibrary code was executed succesfully.
  3. After adding AssemblyResolve, I now got an Exception from "at Microsoft.ClearScript.V8.V8Proxy.LoadNativeLibrary()" with
Cannot load V8 interface assembly. Load failure information for v8-x64.dll: C:\Websites\beta.lawfirm.org.ua\bin\v8-x64.dll: The specified module could not be found C:\Websites\beta.lawfirm.org.ua\v8-x64.dll: The specified module could not be found
I am using this code for AssemblyResolving
var rootPath = HostingEnvironment.MapPath("/Dependencies");
if (args.Name.Contains("ClearScript"))
{
     return Assembly.LoadFrom(Path.Combine(rootPath, "ClearScriptV8-64.dll"));
}
As you see all libs are in Dependencies folder. While v8 is not requested to AssemblyResolver, ClearScriptV8. If I put v8 into root folder, error is the same.

AppDomain.CurrentDomain.BaseDirectory -> "C:\Websites\beta.lawfirm.org.ua\"
AppDomain.CurrentDomain.RelativeSearchPath -> "C:\Websites\beta.lawfirm.org.ua\bin"

New Post: Azure Mobile Services Cannot Load V8 Interface Assembly

$
0
0
Found what was the problem, ClearScript needed C++ redistributable 2012, while I've installed 2013 one.

Edited Issue: Check for DispId attribute when looking for default property [74]

$
0
0
We are using ClearScript in our application as a replacement for the MS Script Control (to enable users to run custom scripts interfacing with an application-provided object), and we've encountered an issue involving legacy behaviour with retrieving default property values, where those objects are .NET objects.

The situation we encountered involved VBScript accessing a DAO-like object:

Something = rs.Fields("something")

where rs.Fields is a method returning an IEnumerable object (a "Fields" object). The object returned by the Fields object (the "Field" object) has a default property as so:

[DispId(0)]
public object Value
{
get { .... }
set { .... }
}

The enumeration is working fine, but the default property would not be identified as such. The VBScript engine was actually looking for "[DISPID=0]", but ClearScript wasn't checking the DispId attribute. The attached patch adds support to check for the DispId attribute.

The attached patch fixes the getting; setting unfortunately still doesn't work with this fix, but we worked around that in our application. (If you have any idea how to fix it in ClearScript as well though, I'm sure that would be useful!)

Hope this is useful, and that my fix is correct!

Thanks, Owen.

Commented Issue: Check for DispId attribute when looking for default property [74]

$
0
0
We are using ClearScript in our application as a replacement for the MS Script Control (to enable users to run custom scripts interfacing with an application-provided object), and we've encountered an issue involving legacy behaviour with retrieving default property values, where those objects are .NET objects.

The situation we encountered involved VBScript accessing a DAO-like object:

Something = rs.Fields("something")

where rs.Fields is a method returning an IEnumerable object (a "Fields" object). The object returned by the Fields object (the "Field" object) has a default property as so:

[DispId(0)]
public object Value
{
get { .... }
set { .... }
}

The enumeration is working fine, but the default property would not be identified as such. The VBScript engine was actually looking for "[DISPID=0]", but ClearScript wasn't checking the DispId attribute. The attached patch adds support to check for the DispId attribute.

The attached patch fixes the getting; setting unfortunately still doesn't work with this fix, but we worked around that in our application. (If you have any idea how to fix it in ClearScript as well though, I'm sure that would be useful!)

Hope this is useful, and that my fix is correct!

Thanks, Owen.
Comments: Owen, a question about the expected behavior. In your scenario, is the VBScript statement `rs.Fields("something") = foo` expected to be equivalent to `rs.Fields("something").Value = foo`? Is it common for VBScript to behave this way when an object has a parameterless default property?

New Post: class not defined error

$
0
0
hi,

So I have this VB script:
productOverride = New ProductValueOverride
productOverride.NewValue = 2
productOverride.ProductId = 24
And I am getting a 'Class not defined: ProductValueOverride'. But I put a break point right before executing the script and looking at the field 'hostItemMap' and the class is there with the exact same spelling.

Any ideas on what can be wrong?
Is there a different syntax to instantiate clr classes?

New Post: Generic types

$
0
0
In the front page of the project it say:
Full support for generic types and methods, including C#-like type inference and explicit type arguments
I am using VBScript...

What would be the proper syntax in vb to instatiate a .Net generic type?

New Post: class not defined error

$
0
0
Hello!

Unfortunately VBScript's New operator works only on VBScript classes. To instantiate a CLR class, you have to use HostFunctions.newObj:
engine.AddHostObject("host", new HostFunctions());
engine.AddHostType("Dictionary", typeof(Dictionary<string, object>));
engine.Execute(@"
    dict = host.newObj(Dictionary)
    dict.Add ""abc"", 123
");
Cheers!

New Post: Generic types

$
0
0
Hi,

Suppose you want to use .NET's Dictionary generic type. The first step is to expose the generic type itself:
engine.AddHostType("Dictionary", typeof(Dictionary<,>));
Next, expose any additional types you need to create the required specific dictionary type. For example:
engine.AddHostType("DayOfWeek", typeof(DayOfWeek));
engine.AddHostType("Int32", typeof(int));
Now you can instantiate your specific type from VBScript code:
engine.AddHostObject("host", new HostFunctions());
engine.Execute(@"
    dict = host.newObj(Dictionary(DayOfWeek, Int32))
    dict.Add DayOfWeek.Monday, 123
");
Note that it's easier and often sufficient to simply expose the specific type instead:
engine.AddHostType("StringDictionary", typeof(Dictionary<string, object>));
engine.Execute(@"
    dict = host.newObj(StringDictionary)
    dict.Add ""abc"", 123
");
Good luck!

New Post: Generic types

$
0
0
This is cool!!!

Where HostFunctions() is defined?

New Post: Generic types

$
0
0
The HostFunctions class is part of the ClearScript library. Take a look at the ClearScript Library Reference, available here.

New Post: Generic types

New Post: class not defined error

New Post: using VB as the scripting lang. How can I invoke the installed debugger from the script?

$
0
0
using VB as the scripting lang. How can I invoke the installed debugger from the script?

New Post: using VB as the scripting lang. How can I invoke the installed debugger from the script?

Viewing all 2297 articles
Browse latest View live




Latest Images