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: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

    1210 devices/features ---- 392 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:
      [SIZE=16px][COLOR=#212529][FONT=Roboto][B]Time[/B][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][B]From[/B][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][B]Type[/B][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][B]Message[/B][/FONT][/COLOR][/SIZE]
      
      
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]7/24/2020 13:45:12[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]HomeSeer[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]Error[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]Compiling script tempdiff.vb: 'intemp' is not declared. It may be inaccessible due to its protection level.[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]7/24/2020 13:45:12[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]HomeSeer[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]Error[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]Compiling script tempdiff.vb: 'outtemp' is not declared. It may be inaccessible due to its protection level.[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]7/24/2020 13:45:12[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]HomeSeer[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]Error[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#FF0000]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.[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#000000]7/24/2020 13:45:11[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#000000]HomeSeer[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#000000]Event[/COLOR][/FONT][/FONT][/COLOR][/SIZE]
      [SIZE=16px][COLOR=#212529][FONT=Roboto][FONT=B612 Mono][COLOR=#000000]Running[/COLOR][/FONT][/FONT][/COLOR][/SIZE]

      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: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

          1210 devices/features ---- 392 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