有没有人知道一种方法来创建一个强类型数据集(嘿,不是我的想法使用它们)可序列化,以便我可以将它们作为会话状态提供程序使用AppFabric Server存储?我一直在使用InProc会话状态一段时间,并没有任何问题。只要我将会话状态移出到AppFabric Server,我就会遇到强类型数据集的一些问题。我不断收到一个错误,告诉我我的数据集不可序列化。我已经检查过,他们有Serializable
属性,它们只包含可序列化的数据类型(int
,string
等)任何thougnts?强类型数据集的序列化
编辑:这里是堆栈跟踪:
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
你能发布你得到的异常堆栈跟踪吗? – 2012-02-25 13:09:04
添加了上面的堆栈跟踪 – bechbd 2012-02-29 17:42:36
这篇SO文章可能是相关的: - http://stackoverflow.com/questions/7891447/how-to-serialize-de-serialize-a-custom-dataset – 2012-02-29 17:51:59