Announcement

Collapse
No announcement yet.

Imports 'System.Core' doesn't contain any public member or cannot be found

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

    Imports 'System.Core' doesn't contain any public member or cannot be found

    I thought this used to work.
    Any ideas?

    Compiling script tempdiff.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    Code:
    Sub Main(ByVal Parm As Object)
    
    Dim outtemp as string
    Dim intemp as string
    Dim diff as string
    Dim tempdiffswitch as string
    Dim tempdiff as string
    
    
    Try
    hs.WriteLog("Info","Starting Temp Difference B")
    
    tempdiffswitch = hs.GetDeviceRefByName("Temperature Difference")
    tempdiff = hs.GetDeviceRefByName("Utility Weather tempdiff")
    
    outtemp = hs.GetDeviceRefByName("Outdoor Temperature")
    
    hs.WriteLog("Info","outtemp ID: "& outtemp)
    hs.WriteLog("Info","outtemp: "& hs.deviceValue(outtemp))
    
    intemp = hs.GetDeviceRefByName("Kitchen Motion - Temperature")
    
    hs.WriteLog("Info","intemp ID: "& intemp)
    hs.WriteLog("Info","intemp: "& hs.deviceValue(intemp) )
    
    
    
    diff = hs.deviceValue(intemp) - hs.deviceValue(outtemp)
    
    hs.WriteLog("Info","diff: "& diff)
    
    hs.SetDeviceValueByRef(tempdiff, diff, True)
    
    
    if diff > 3 then
    
    hs.WriteLog("Info","switch ON ")
    
    hs.SetDeviceValueByRef(tempdiffswitch, 100, True)
    hs.setDeviceString(tempdiffswitch,"100",True)
    
    else
    
    hs.WriteLog("Info","switch OFF ")
    
    hs.SetDeviceValueByRef(tempdiffswitch, 0, True)
    hs.setDeviceString(tempdiffswitch,"0",True)
    
    
    
    end if
    
    
    hs.WriteLog("Info","Starting Temp Difference B 100")
    
    
    Catch ex As Exception : hs.writelog("", "Exception: " & ex.message)
    
    End Try
    
    
    
    
    
    
    End Sub



    #2
    Change the writelog("a","b") in writelogex("a","b", "") and see it is solving the error? The last parameter can be a colorcode.

    Wim
    -- Wim

    Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
    650 devices ---- 336 events ----- 40 scripts

    Comment


      #3
      Stripped everything. See errors below:


      Code:
      Sub Main(ByVal str0 As String)
      
      Dim outtemp as string
      Dim intemp as string
      Dim diff as string
      Dim tempdiffswitch as string
      Dim tempdiff as string
      
      
      
      
      
      
      
      End Sub

      Code:
      Time
      From
      Type
      Message
      
      
      7/24/2020 13:45:12
      HomeSeer
      Error
      Compiling script tempdiff.vb: 'intemp' is not declared. It may be inaccessible due to its protection level.
      
      7/24/2020 13:45:12
      HomeSeer
      Error
      Compiling script tempdiff.vb: 'outtemp' is not declared. It may be inaccessible due to its protection level.
      
      7/24/2020 13:45:12
      HomeSeer
      Error
      Compiling script tempdiff.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
      
      7/24/2020 13:45:11
      HomeSeer
      Event
      Running

      Comment


        #4
        Something weird happening here. I changed the name of the vars and it still has the old script loaded.

        Comment


          #5
          That should be dynamic, but never tested this with HS4 yet. Still slowly moving to HS4. On the other hand, the catch is called now, so I guess the writelogex change is working now. Nothing else changed?
          -- Wim

          Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
          650 devices ---- 336 events ----- 40 scripts

          Comment


            #6
            It's not reading the script. I tore the actual script down and only have the vars. I also renamed the vars but it still refers to the old var.

            So first thing is finding out why it's not reading the script

            Comment


              #7
              Did you ever solve this? I have the same kind of migration problem.

              Comment

              Working...
              X