Solved

Unable to Serialize Session State

Posted on 2013-12-10
5
278 Views
Last Modified: 2013-12-17
Created asp.net program on VS2012 desktop development system and it works fine.

When I move the program to our web server I get the error "Unable to Serialize Session State" when I run program.

I have two or three string session variables and one arraylist stored in session variable.
The array list data is a struct consisting of three strings.

Program has only one aspx form with vbcodebehind.

What do I need to do to make this work outside of vs2012  (Framework 2.0)

any help with vb examples would be appreciated.

Lee
0
Comment
Question by:trims30
  • 4
5 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
Comment Utility
Check the Sessiona state setting on web server in config files . may be it is disabled.
Compare it with you local machine
0
 

Author Comment

by:trims30
Comment Utility
I don't have any control of the server - it's a shared server I subscribe to.
Any other suggestions?
0
 

Author Comment

by:trims30
Comment Utility
Code that causes error can be demonstrated by two subroutines below.
btnTA_Click saves an arraylist to session with no error
btnTS_Click saves an arraylist (Structure) to session and causes error.

Public Class _Default
    Inherits System.Web.UI.Page
    Structure HoursData
        Dim Project As String
        Dim Activity As String
        Dim Hours As String
    End Structure

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnTA_Click(sender As Object, e As EventArgs) Handles btnTA.Click
        Dim PinNumbers As New ArrayList
        PinNumbers.Add("1")
        PinNumbers.Add("2")
        PinNumbers.Add("3")
        Session("Pin") = PinNumbers  'THIS ARRAY IS SUCCESSFULLY SAVED TO SESSION
    End Sub

    Protected Sub btnTS_Click(sender As Object, e As EventArgs) Handles btnTS.Click
        Dim Dailywork As HoursData
        Dim Activities As New ArrayList
        Dailywork.Project = "Proj"
        Dailywork.Activity = "Act"
        Dailywork.Hours = "Hrs"
        Activities.Add(Dailywork)
        Session("Acts") = Activities 'THIS ARRAY CAUSES SERIALIZE ERROR WHEN SAVED TO SESSION
    End Sub
End Class

Open in new window

0
 

Accepted Solution

by:
trims30 earned 0 total points
Comment Utility
had to rewrite and eliminated structures in arraylist.
All working OK now.
0
 

Author Closing Comment

by:trims30
Comment Utility
cannot do anything to configure server since it's shared server
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now