VB.NET Scripts and Namespaces

.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.

By 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

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)