This is a migrated thread and some comments may be shown as answers.

SerializationException error extracting SortExpressions

4 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Leslie Quadros
Top achievements
Rank 1
Leslie Quadros asked on 10 Jul 2008, 05:14 PM

I am using radgrid for asp.net version 4.5 (r.a.d.controlsQ4 2006).
The following code works when I run on visual studio but errors out when deployed to the IIS web servers -

Dim sortExp As GridSortExpressionCollection = RadGridCalendar.MasterTableView.SortExpressions()
If Not sortExp Is Nothing Then
            Session.Add("CAL_SORT", sortExp)
        'Else
            Session.Add("CAL_SORT", "")
 End If
I use the above session variable and apply the sort to another RadGrid.
The error I get is -
Exception type: SerializationException     Exception message: Type 'Telerik.WebControls.GridSortExpressionCollection' in Assembly 'RadGrid.Net2, Version=4.5.0.0, Culture=neutral, PublicKeyToken=ec87bc2939ec45df' is not marked as serializable.

The stack trace is -

Stack trace:    at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)

   at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)

   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)

   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)

   at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)

  Custom event details:


Any help will be appreciated.
Thanks.

4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 11 Jul 2008, 01:28 PM
Hi Leslie,

Can you verify that the application deployed on the server has the most recend dlls for the grid applied?

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Leslie Quadros
Top achievements
Rank 1
answered on 11 Jul 2008, 04:04 PM
Yes, the DLL that is in the BIN folder of the application is the same one that is copied to the web server.That is, the whole app along with the BIN folder is copied to the web server. The code works with the exact same DLL in Visual Studio but not on the web servers.

0
Yavor
Telerik team
answered on 15 Jul 2008, 05:43 AM
Hello Leslie,

I suspect that there is a problem with the datasource you are binding the grid control to. However, based on the information furnished, it is hard to determine the precise cause.
At this point, it would be best if you send us a small working project, in a formal support ticket, which represents your logic. I will test it locally, and advise you further.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lisa
Top achievements
Rank 1
answered on 21 Aug 2008, 02:34 AM
Hi there

Is it possible you are using the aspnet_state service on your IIS server to manage sessions?  If so, your web.config would have a value of  <sessionState mode="StateServer" rather than <sessionState mode="InProc".  Anything stored in the session variables must be serializable if "stateServer" is being used to manage sessions.  I'm having the same issue - it doesn't look like the GridSortExpressionCollection class is serializable.

cheers
Lisa
Tags
Grid
Asked by
Leslie Quadros
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Leslie Quadros
Top achievements
Rank 1
Lisa
Top achievements
Rank 1
Share this question
or