SQL Server 会话状态导致序列化错误
我有一个使用默认 WCF 序列化的 .Net 3x 应用程序,最近设置了使用 SQL Server 会话状态的应用程序,但无法将这些对象存储在 sql server 的会话状态中,只能存储在 proc 会话状态中。
在各种类上出现错误,指出:
无法序列化会话状态。在“StateServer”和“SQLServer”模式下,ASP.NET 将序列化会话状态对象,因此不允许使用不可序列化的对象或 MarshalByRef 对象。如果自定义会话状态存储在“自定义”模式下完成类似的序列化,则适用相同的限制。
我认为 wcf 的默认序列化就足够了,但显然还不够。关于需要做什么来纠正编辑整个应用程序并将 [Serialized] 添加到类中的问题有什么想法吗?
I have an .Net 3x application using default WCF serialization and recently setup application to use SQL Server Session state and am not being able to store those objects in session state with sql server, only in proc session state.
Getting errors on various classes stating:
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 restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
I assumed that the default serialization of wcf would be sufficient but apparently not. Any ideas on what needs to be done to correct this short of editing entire app and adding [Serializable] to classes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来你有四个选择:
选项 3 通常会比 2 运行得更快,尽管它也需要更多工作。
It seems like you have four choices:
Option 3 will generally run faster than 2, although it's also more work.