Solved

Unable to Serialize Session State

Posted on 2013-12-10
5
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39710608
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
ID: 39711123
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
ID: 39711252
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
ID: 39715368
had to rewrite and eliminated structures in arraylist.
All working OK now.
0
 

Author Closing Comment

by:trims30
ID: 39723500
cannot do anything to configure server since it's shared server
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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