473,796 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to serialize the session state.

Hi guys,

Because of restarting application after new DLLs installed into \Bin folder
, we move the session to StateServer, everything'a alright except when I try
to write any simple hash table into session. The Error message shows like
----------------------------------------------------------------------------
-----
Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
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.Web.Http Exception: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
----------------------------------------------------------------------------
------

After reading some posts here and MSDN articles and makes me even more
confused because Hashtable object is ISerializable , and all things write
into hashtable are just strings, so should I do something else? or have to
manually serialize hashtable object by mysel ?

Thanks

Bill
Nov 18 '05 #1
1 3722
>
After reading some posts here and MSDN articles and makes me even more
confused because Hashtable object is ISerializable , and all things write
into hashtable are just strings, so should I do something else? or have to
manually serialize hashtable object by mysel ?

Thanks

Bill


Here is stack info,

[SerializationEx ception: The type QMBI.General.In clude.AccessedP age in
Assembly QMBI.General.In clude, Version=0.0.0.0 , Culture=neutral ,
PublicKeyToken= null is not marked as serializable.]

System.Runtime. Serialization.F ormatterService s.InternalGetSe rializableMembe r
s(RuntimeType type, Boolean excludeNonSeria lizable) +853

System.Runtime. Serialization.F ormatterService s.GetSerializab leMembers(Type
type, StreamingContex t context) +300

System.Runtime. Serialization.F ormatters.Binar y.WriteObjectIn fo.InitMemberIn f
o() +103

System.Runtime. Serialization.F ormatters.Binar y.WriteObjectIn fo.InitSerializ e
(Object obj, ISurrogateSelec tor surrogateSelect or, StreamingContex t context,
SerObjectInfoIn it serObjectInfoIn it, IFormatterConve rter converter) +493

System.Runtime. Serialization.F ormatters.Binar y.WriteObjectIn fo.Serialize(Ob j
ect obj, ISurrogateSelec tor surrogateSelect or, StreamingContex t context,
SerObjectInfoIn it serObjectInfoIn it, IFormatterConve rter converter) +48

System.Runtime. Serialization.F ormatters.Binar y.ObjectWriter. Serialize(Objec t
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +683

System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Serialize(St r
eam serializationSt ream, Object graph, Header[] headers, Boolean fCheck)
+136
System.Web.Util .AltSerializati on.WriteValueTo Stream(Object value,
BinaryWriter writer) +1621

[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util .AltSerializati on.WriteValueTo Stream(Object value,
BinaryWriter writer) +1711
System.Web.Sess ionState.Sessio nDictionary.Ser ialize(BinaryWr iter writer)
+148
System.Web.Sess ionState.StateC lientManager.Se rialize(Session StateItem
item, Stream stream) +146

System.Web.Sess ionState.OutOfP rocStateClientM anager.System.W eb.SessionState .
IStateClientMan ager.Set(String id, SessionStateIte m item, Boolean inStorage)
+121
System.Web.Sess ionState.Sessio nStateModule.On ReleaseState(Ob ject source,
EventArgs eventArgs) +465

System.Web.Sync EventExecutionS tep.System.Web. HttpApplication +IExecutionStep .
Execute() +60
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +87

seems .net do serialization for the hashtable object but the stream object
is MarshalByRefObj ect, then the error occurs... what can I do to fix that ?

Bill
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3945
by: Dave | last post by:
We just started getting this error message in our application today (stack trace below). From the OutOfMemoryException, I'm guessing it could be a memory leak. I'm making sure I'm closing all my connections in the finally block but I'm not sure what I should be doing. As far as the "Unable to serialize the session state" error, this app has been running for days and this is the first I've seen this one as well. Any thoughts would be...
0
800
by: Maciek | last post by:
Hi When I set Session state mode to StateServer (IIS 6.0; windows2003; .NET 2.0) in my application, I have recived this message: ----------------------------------------------------------------------------------------------------------------- Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a...
1
1468
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. Database.cs DatabaseFactory.cs DatabaseProviderFactory.cs DBCommandWrapper.cs
1
39709
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same
6
492
by: tshad | last post by:
I had asked about this before, but have been unable to solve the problem. Could this be a problem with Web Services? I have 4 web services that I reference in this object. There is only one class. I have an object I am unable to put in my session. I have others that have no problem. The difference is the the one I am having problems with was created in VS 2003. The others were created using DW and compiling using the commandline...
0
2014
by: Nachi | last post by:
I have installed SQL Server 2000 with VS 2005 - did not install SqlExpress\Sql 2005. I have a remote Sql Server Instance locally. The normal application connectes to this Sql Server. When I run Asp.Net Configuration from VS 2005 it gives this error. I have removed 'LocalSqlServer' in machine.Config and added in web.config as following.
3
3715
by: =?Utf-8?B?VG9ueSBTZXI=?= | last post by:
Come across an issue with IIS process HTTP request one by one, not simultaneously. I have a page that takes a long time to process. When the page is accessed by 2 seperate browser, both request will be processed the same time. But if the 2nd browser is opened by IE->File->New Window, when the 2 browsers try to access the same page, the requests are handle sequentially. Same behaviour with 2 firefox browser.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.