Announcement

Collapse
No announcement yet.

Scripting question

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

    Scripting question

    I want to use the "Dictionary" object in a vb.net script. When I code it in the script and run the script, I get the following error.

    Compiling script C:\Program Files\HomeSeer HS3\scripts\TaskerParser.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    After reading the homeseer documentation on "vb.net scripts and namespaces", I am not really sure which imports I need. Also, I am not sure what do, if anything, to the settings.INI file.

    #2
    Some times you need to add things to the Settings.ini file in the ScriptingReferences line and sometimes you don't, I'm never sure why but add

    Imports System.Collections.Generic

    to the very top of your script and see whether you can run it without error.

    Comment


      #3
      I will add that Imports 'System.Core' messages often appears if there is an error in a script and has no relationship to the actual error!
      Jon

      Comment


        #4
        That fixed it.

        Originally posted by mrhappy View Post
        Some times you need to add things to the Settings.ini file in the ScriptingReferences line and sometimes you don't, I'm never sure why but add

        Imports System.Collections.Generic

        to the very top of your script and see whether you can run it without error.
        Adding the IMPORTS worked. The dictionary objects now work. I wonder if there is a way to do the same thing in the settings.INI? I am using the tenholder IDE and I can't get the imports statement to work. I currently have to export the script and the manually add the IMPORTS statement at the top.

        Comment


          #5
          Originally posted by jimbell View Post
          Adding the IMPORTS worked. The dictionary objects now work. I wonder if there is a way to do the same thing in the settings.INI? I am using the tenholder IDE and I can't get the imports statement to work. I currently have to export the script and the manually add the IMPORTS statement at the top.
          In tenScripting, place the Imports statement before the class definition so that Visual Studio accepts it, and processes it correctly when the project is run. When you export your script to the HS script folder, the Imports statement that is before the CLASS statement will be copied to your HS script file correctly. If you have multiple script definitions within the same tenScripting file, all Imports at the top of the file will be copied into any/all scripts that are exported to HS.

          Let me know if this does/does not work for you.

          tenholde
          tenholde

          Comment

          Working...
          X