测试服务器上的 asp.net 序列化问题
我一直在开发一个项目,它在我的开发机器上运行良好。当我将其移至阶段服务器进行测试时,出现以下错误:
Unable to serialize the session state. In 'StateServer' and 'SQLServer'
错误消息继续指定我的业务对象之一为问题。该代码实际上是由另一位开发人员开发的,但我认为问题在于将业务对象保存到会话中时。
为什么它可以在我的本地计算机上运行,但不能在远程服务器上运行?
I have been working on a project and it works fine on my development machine. When I move it to the stage server for testing I get the following error:
Unable to serialize the session state. In 'StateServer' and 'SQLServer'
The error message goes on to specify one of my business objects as the issue. The code was actually developed by another developer but I believe the issue is when a business object is saved into the session.
Why would that work on my local machine but not on the remote server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的开发机器可能使用序列化到内存的 InProc 会话提供程序。当使用 SQLServer 会话提供程序时,对对象有更严格的要求。
最有可能的是 - 你的对象之一是不可序列化的。原因可能各不相同,从简单的“未标记为可序列化”到“依赖于不可序列化的外部类型”。
尝试通过检查内部异常来追踪有问题的类型。通常您会在那里找到有意义的信息。
You development machine probably uses the InProc session provider which serializes onto memory. When the SQLServer session provider is used, there are are much stronger requirements on your objects.
Most probably - one of your objects is just not serializable. Reasons could vary, from simple "not marked as serializable" to "relying on external types which are not serializable".
Try to track down the problematic type by inspecting the inner exception. Usually you'll find a meaning information there.