Announcement

Collapse
No announcement yet.

Compile Error with C# Script

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

  • Compile Error with C# Script

    I have an extremely simple C# script:

    public void Test(object param)
    {}

    I then have an event that calls Test. I trigger the event manually. However, it fails to compile with the error listed below. I can't think of a simpler script so I don't know why this doesn't compile. Also, it appears that HS is wrapping the script and the error comes from there but the error message really doesn't give much clues on what is going on. Any help is appreciated.

    Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\MyScript.cs: {interactive}(4,6): error CS1525: Unexpected symbol `System', expecting `(' {interactive}(5,6): error CS1525: Unexpected symbol `System', expecting `(' {interactive}(6,6): error CS1525: Unexpected symbol `Scheduler', expecting `(' {interactive}(7,6): error CS1525: Unexpected symbol `HomeSeerAPI', expecting `(' {interactive}(8,0): error CS1525: Unexpected symbol `public', expecting `(' {interactive}(10,2): error CS1525: Unexpected symbol `public', expecting `(' {interactive}(12,1): error CS1525: Unexpected symbol `}', expecting `(' {interactive}(339,37): error CS8025: Parsing error

  • #2
    Try this instead:

    Code:
    public object Main(object[] param)
    {
      hs.WriteLog("Test-Script", "Worked");
      return 0;
    }

    Comment

    Working...
    X