I have to be doing something wrong but searches for a solution yields null...
I have events executing C# scripts which must load namespaces/types from my own class library. I am unable to make this work.
As I have learned:
So, my script now looks like this:
I copied the AVRControler.dll file into my HS4 root, <HS4 root>\scripts and <HS4 root>\bin\homeseer for good measure. Still fails with error:
{interactive}(25,9): error CS0246: The type or namespace name `AVRControler' could not be found. Are you missing a using directive or an assembly reference?
Details of the class library assembly:
I have events executing C# scripts which must load namespaces/types from my own class library. I am unable to make this work.
As I have learned:
- Config.ini's ScriptingReferences setting only pertains to VB script. So don't even bother using this
- To load/import types from an assembly DLL you must add a line to the C# script:
//css_reference <your_dll>;
So, my script now looks like this:
Code:
//css_reference AVRControler.dll; using AVRControler; public object Main( string myParamText) { AVRControler.CAVR myAvr = new AVRControler.CAVR(); hs.WriteLog("xxxx", "Woo Hoo!"); return( true ); }
I copied the AVRControler.dll file into my HS4 root, <HS4 root>\scripts and <HS4 root>\bin\homeseer for good measure. Still fails with error:
{interactive}(25,9): error CS0246: The type or namespace name `AVRControler' could not be found. Are you missing a using directive or an assembly reference?
Details of the class library assembly:
- .Net Framework v4.6.2
- C#
- Built for "any cpu"
Comment