Skip to main content
Skip table of contents

VB.NET Scripts and NameSpaces

Note: This section is for VB.NET scripting only, for adding references to other DLL files, see the CSharp Scripting section.

.NET uses "Namespaces" to refer to large libraries of code, which are not included in your VB.NET program or script unless you tell it that you wish to have it included.

nBy default, VB.NET scripts executed by HomeSeer will have the System.dll referenced, which means that to use a namespace within that library, add the IMPORTS statement to the top of your VB.NET script like this:
       IMPORTS System.IO
       IMPORTS System.Net

Note that all namespaces under System are not necessarily included in System.dll - some System namespaces are in additional dll files.

If you wish to use other namespaces referenced in other libraries, you must first tell HomeSeer to include the library reference when it initializes the script engine.  To do this, add your reference to the INI entry "ScriptingReferences", which is under the [Settings] section in your \Config\Settings.INI file.

You can add references by including the namespace, a semicolon, and the dll file name in this entry.  Multiple references can be added by separating them with a comma.  Here is an example that adds a reference to 2 namespaces:

ScriptingReferences =

System.Management;System.Management.dll,System.Drawing;System.Drawing.dll
 

When broken down into individual parts:

ScriptingReferences =

System.Management;System.Management.dll,System.Drawing;System.Drawing.dll
  (Namespace1)    (DLL for Namespace1)  (Namespace2)  (DLL for Namespace2)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.