Quantcast
Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Showcase


Channel Catalog



Channel Description:

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.

older | 1 | .... | 67 | 68 | (Page 69) | 70 | 71 | .... | 115 | newer

    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!

    0 0

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

    0 0

    Thanks for quick response. It is helpful.

    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

    0 0

    Hi Satyendra,

    Unfortunately the V8 team has dropped support for Visual Studio 2012.

    You should be able to generate ClearScript binaries externally with a free version of Visual Studio 2013 and import them into your build environment. Just be sure to install the Visual C++ Redistributable Packages for Visual Studio 2013 as necessary.

    Thanks, and good luck!

    0 0
    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"

    0 0

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

    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.

    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?

    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?

    0 0
  • 04/01/15--08:02: New Post: Generic types
  • 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?

    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!

    0 0
  • 04/01/15--09:40: New Post: Generic types
  • 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!

    0 0
  • 04/01/15--13:55: New Post: Generic types
  • This is cool!!!

    Where HostFunctions() is defined?

    0 0
  • 04/01/15--16:01: New Post: Generic types
  • The HostFunctions class is part of the ClearScript library. Take a look at the ClearScript Library Reference, available here.

    0 0
  • 04/02/15--05:52: New Post: Generic types
  • Awesome, this is working!

    0 0

    Awesome, now it works

    0 0

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

    0 0

    You can use VBScript's Stop statement.

older | 1 | .... | 67 | 68 | (Page 69) | 70 | 71 | .... | 115 | newer