无法序列化会话状态
我有 ASP.NET 网站,并尝试将会话从 inproc 模式更改为 sql 模式。我将“可序列化”属性放入用户定义的类中,但收到“无法序列化会话状态”错误页面。看起来我正在引用用户定义的类中未标记为“可序列化”的另一个类。我无法将这些类标记为“可序列化”,因为我仅通过 dll 文件引用。
我该如何解决这个问题?
I have asp.net web site and trying to change from inproc to sql mode for the session. I put "serizlizable" attriubte in the user defined classes but I am getting the "Unable to serialize the session state" error page. It looks like I am referencing another classes in side of the user defined classes that are not marked as "serializable". I can't mark these classes as "Serializable" since I am only referencing by dll files.
How can i solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过自己编写您可以控制的其他自定义类,您可以使用
Serialized
标记这些类,并将这些自定义类存储到会话中。就原始类和新的自定义类之间的映射而言,AutoMapper 可以简化它。也就是说,如果不将类标记为可序列化,则无法将其存储到进程外会话中。By writing other custom classes yourself that you have control over and which you could mark with
Serializable
and storing those custom classes into the session. As far as the mapping between the original classes and those new custom classes is concerned, AutoMapper could simplify it. That is to say, you cannot store a class into out-of-process session without it being marked as serializable.