【发布时间】:2012-02-24 22:24:33
【问题描述】:
有没有人知道一种方法可以使强类型数据集(嘿,我不想使用它们)可序列化,以便我可以使用 AppFabric Server 作为会话状态提供程序来存储它们?我已经使用 InProc Session 状态一段时间了,对此没有任何问题。一旦我将会话状态移到 AppFabric 服务器,我就会遇到一些强类型数据集的问题。我不断收到错误消息,告诉我我的数据集不可序列化。我已经检查过了,它们上面有 Serializable 属性,它们只包含可序列化的数据类型(int、string 等)有什么想法吗?
编辑:这是堆栈跟踪:
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
【问题讨论】:
-
你能发布你得到的异常堆栈跟踪吗?
-
这篇 SO 文章可能是相关的:- stackoverflow.com/questions/7891447/…
标签: asp.net .net vb.net appfabric