So after sort of giving up on importing an and using an external dll that I had created I decided to try and compile the classes that I needed in my c# script. I was able to get everything compiled through trial and error but have been unable to create a class object that is i created within the script. The error message is as shown.
If I do not call the class, the function works as expected writing to the log.
I assume this means I cannot declare a class within a C# Script? What are my options? Are there anyworkarounds?
As an aside, I referenced dll's the way I understood it from the documentation. Is this correct? Using crashes the compiler...
Oct-07 3:34:54 PM Error 1 Running script more info: Object reference not set to an instance of an object
Oct-07 3:34:54 PM Error 1 Running script /usr/local/HomeSeer/scripts/MyFunctions.cs :Exception has been thrown by the target of an invocation.
Thoughts?
If I do not call the class, the function works as expected writing to the log.
I assume this means I cannot declare a class within a C# Script? What are my options? Are there anyworkarounds?
As an aside, I referenced dll's the way I understood it from the documentation. Is this correct? Using crashes the compiler...
Oct-07 3:34:54 PM Error 1 Running script more info: Object reference not set to an instance of an object
Oct-07 3:34:54 PM Error 1 Running script /usr/local/HomeSeer/scripts/MyFunctions.cs :Exception has been thrown by the target of an invocation.
Code:
//css_reference System.Data.dll; //css_reference /usr/lib/mono/4.5/mscorlib.dll; public void Main(object[] param) { hs.WriteLog("CustomFunction","Before Creation of new DailyInformation Object"); hs.WriteLog("CustomFunction",DateTime.Now.ToString()); DailyInformation di = new DailyInformation(DateTime.Now); hs.WriteLog("CustomFunction",di.ToString()); hs.WriteLog("CustomFunction","After Creation of new DailyInformation Object"); return ; } public class DailyInformation { //blah blah blah... }
Comment