Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unable to Serialize Session State

Posted on 2013-12-10
5
Medium Priority
?
295 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

719 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