Announcement

Collapse
No announcement yet.

All my .net scripts have stopped working

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

    All my .net scripts have stopped working

    A three days ago I was playing with a couple vb.net scripts in visual studio and tenscripting. I really only have two .net scripts as I'm somewhat new to SW development. I was using Save As on my scripts while experimenting. This caused visual studio/tenscripting to error out due to duplicate class names (same class name in multiple files) in the same project directory. Ed was kind enough to point this out to me and I was able to fix the visual studio/tenscripting development environment.

    However when this happened HS also seems to have been messed up somehow. I found none (both) of my .net scrips in the HS scripts directory would run anymore after working fine for days. Even after fixing the visual studio problem and making sure my HS scripts directory was clean of duplicate class names it's still messed up. New vb.net scripts won't run either, a super simple example is below.

    File name=test1.vb in HS scripts directory

    Public Class test1
    Public Sub Main(ByVal dummy As String)
    'test for why I'm getting method not found errors
    hs.WriteLog("test", "Yep, it ran ok")
    End Sub
    End Class

    All of my vb.net scripts now run fine again in visual studio/tenscripting, but in HS they all generate a "Method not found" error. I tried adding ("Main") in the Additional Parameters box to no avail. Yes, these vb.net scripts use Main as the Public Sub name.

    Also note my regular scripts (not .net) still run fine.

    Am I doing something stupid?

    Anyone else experience this before?

    Do I have to reinstall HS?

    I'm about to leave on vacation and very much need HS to run while I'm gone so anything I do to try and fix this will have to be done when I return.

    Thanks.

    #2
    test1.vb should only contain the following, with the class wrapper

    Public Sub Main(ByVal dummy As String)
    'test for why I'm getting method not found errors
    hs.WriteLog("test", "Yep, it ran ok")
    End Sub

    tenscripting must not be publishing the script correctly, it usually removed the class definition
    Mark

    HS3 Pro 3.0.0.534
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
    Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

    Comment


      #3
      Yep, this falls under "I'm doing something stupid". That fixed it.

      Thanks.

      Comment


        #4
        Did tenScripting export the script this way? Something is not right if it did.

        tenholde
        tenholde

        Comment


          #5
          No, it did it right.

          After the export I looked in the file in HS and noticed the class statements were gone. I thought they somehow disappeared and I re-added them. Then I got sidetracked and when I returned found that nothing worked. I freaked and started experimenting with a variety of things (like using Save As), which just made the situation worse.

          So again this was all my error.

          I'm picking up a book on vb.net today as I need to work on my theory before continuing. I'm a bit dangerous right now .

          Comment


            #6
            Let me know if I can help,
            tenholde
            tenholde

            Comment

            Working...
            X