Announcement

Collapse
No announcement yet.

Problems with new scripting reference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problems with new scripting reference

    I'm trying to do some fuzzy matching in a script, and want to use the SimMetrics.NET library for this, and I mocked it up in Visual Studio where it worked fine, then I added the assembly to the scripting references and tried my script in HS and it fails with the totally not helpful message:

    Running script C:\Program Files (x86)\HomeSeer HS3\scripts\Sage.vb :Exception has been thrown by the target of an invocation.->Does entry point StartShow exist in script? at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Obj ect obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Scheduler.clsRunVBNetScript.ExecuteScript()

    If I comment out the line where I instantiate the object, the error goes away, and I've even boiled it down to a script that does nothing but create a new Levenstein [sic] object in that library. If I just declare the variable, there are no complaints about the type definition (which would have a different, more useful error), but as soon as I "New" it, the script blows up.

    Any thoughts?

    #2
    I just put the distance/scoring logic directly in my script so I didn't need a reference, and that got me past this error. However, one of the next things I uncommented was a web call followed by a Newtonsoft deserialize command. When that line is commented out, it works (no errors, though my code does nothing since the object is nothing). If I leave this line in I get the same error:

    objMediaSearch = JsonConvert.DeserializeObject(Of MediaFileSearch)(strResponse)

    I'm running version .470, so maybe this is a problem in the beta...

    Comment


      #3
      windows or linux HS3?
      tenholde

      Comment


        #4
        Originally posted by tenholde View Post
        windows or linux HS3?
        Windows.

        Comment


          #5
          I created a much simpler test script that just did the JSON deserialization of a given string constant, and then I got a better error message about version mismatches, at which point I discovered there was already a newtonsoft dll in the bin\HomeSeer directory, and the one I was trying to load from one of my plugin bin directories was a different version. The scripting engine doesn't give you the HS one automatically, but it also really doesn't like it if you try to give it a different one in ScriptingRefererences!

          I changed the directory in the reference to the bin\homeseer version and my script worked perfectly. Not sure why the error message wasn't more helpful in the original script, but either way, it's resolved now, so I can now start controlling my Sage TV players using Google Assistant

          Comment

          Working...
          X