Announcement

Collapse
No announcement yet.

Help with CreateStringClass

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

    Help with CreateStringClass

    I am using Visual Web Developer to write an ASPX page with the vb.net codebehind model.

    This line of code:

    Dim fs = hs.CreateStringClass()

    causes this error:

    Server Error in '/bsfWeather_aspx' Application.
    Type 'Scheduler.Classes.clsString' in Assembly 'Scheduler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.Serialization.SerializationException: Type 'Scheduler.Classes.clsString' in Assembly 'Scheduler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

    Does anyone have any ideas why?

    #2
    not sure - try:

    dim fs as Object = hs.CreateStringClass()

    or

    dim fs as Scheduler.Classes.clsString = hs.CreateStringClass()
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Thanks for the suggestions.

      Both statements cause the exact same error as the original error.

      Comment


        #4
        Interesting... I know that in a regular .vb script, that the Dim fs as Object = hs.CreateStringClass() works - I would have thought that in an aspx it would have been the same.

        So, you have an aspx page - is the vb code in the same file or are you using a .vb in the code-behind?
        HS4Pro on a Raspberry Pi4
        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

        HSTouch Clients: 1 Android

        Comment


          #5
          Use System.Text.StringBuilder class

          tenholde
          tenholde

          Comment


            #6
            Thanks Ed. That did the trick.

            Comment

            Working...
            X