Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7604009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:47:54+00:00 2026-05-30T23:47:54+00:00

Does anyone know a way to make a strongly typed dataset (Hey not my

  • 0

Does anyone know a way to make a strongly typed dataset (Hey not my idea to use them) serializable so that I can store them using AppFabric Server as a Session State provider? I have been using InProc Session state for some time now and haven’t had any issues with this. As soon as I moved the Session state out to AppFabric Server I am getting some issues with strongly typed datasets. I keep getting an error telling me that my datasets aren’t serializable. I have checked and they have the Serializable attribute on them and they only contain serializable data types (int, string, etc.) Any thougnts?

Edit: Here is the Stack Trace:

System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type ''DataSetClasses.MyStronglyTypedDataset'' was not found. ---> System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type ''DataSetClasses.MyStronglyTypedDataset'' was not found. at System.Runtime.Serialization.ObjectManager.GetConstructor(RuntimeType t, RuntimeType[] ctorParams) at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) --- End of inner exception stack trace --- at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader reader) at System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert() at System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String name, Boolean check) at System.Web.SessionState.SessionStateItemCollection.get_Item(String name) at System.Web.SessionState.HttpSessionStateContainer.get_Item(String name) at System.Web.SessionState.HttpSessionState.get_Item(String name) at appt.T2SharedLibrarySetup.btnSave_Click(Object sender, EventArgs e) in D:\Application\ProblemFile.aspx.vb:line 331 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:47:55+00:00Added an answer on May 30, 2026 at 11:47 pm

    Try serializing / deserializing the object to a byte array first before you attempt to put it into session (and thence to AppFabric). Here is an example.

            private static BinaryFormatter formatter = null;
    
        private static Byte[] Serialize(object entity)
        {
            Logger.LogDebug(Category.Cache, "Serializing");
            Byte[] bytes;
            if (formatter == null) formatter = new BinaryFormatter();
            using (MemoryStream stream = new MemoryStream())
            {
                formatter.Serialize(stream, entity);
                bytes = stream.ToArray();
            }
            return bytes;
        }
    
        private static object DeSerialize(Byte[] bytes)
        {
            #region Sanitation
            if (bytes == null) { throw new System.ArgumentNullException("bytes"); }
            #endregion
            Logger.LogDebug(Category.Cache, "DeSerializing");
            object obj;
            if (formatter == null) formatter = new BinaryFormatter();
            using (MemoryStream stream = new MemoryStream(bytes))
            {
                obj = formatter.Deserialize(stream);
            }
            return obj;
        }
    

    After you get the object back from the deserializer attempt to cast it back to your typed dataset type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a way to make an AIR app display over top
Does anyone know if there is a simple way to make images snap to
Does anyone know of any way to make a datasource configuration change in WAS
Does anyone know a way to intercept the call Hibernate will make to instantiate
Does anyone know a way to make an asp button... <asp:button runat=server>Button1</asp:button> resemble an
does anyone know whether there is a way to make an image grayscale on
Does anyone know if there is a way to make an Excel 2003 Document
Does anyone know a way to auto-generate database tables for a given class? I'm
Does anyone know a way to find out programatically which physical disk holds a
does anyone know a way to call a generic method of a base class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.