我正在从 1.1 Web 应用程序中调用我们的内部 WCF 服务之一,并返回一个类型,然后将其存储在会话中。
返回的类型包含页面的数据,当页面呈现时,我收到以下消息:
“无法序列化会话状态。请注意,当会话状态模式为“StateServer”或“时,不允许使用非可序列化对象或 MarshalByRef 对象” SQLServer”。
我不明白为什么我无法将从服务返回的类型存储到会话变量中。
如果我将配置更改为“InProc”,那么它就可以工作。
感谢您的反馈。
I'm making a call to one of our internal WCF services from within a 1.1 web application and returning a type which I then store in session.
The returned type contains data for the page and when the page renders I get the following message:
"Unable to serialize the session state. Please note that non-seriWializable objects or MarshalByRef objects are not permitted when session state mode is "StateServer" or "SQLServer".
I don't understand why I would not be able to stored a type returned from a service into a session variable.
If I changed the config to "InProc" then it works.
Appreciate your feedback.
发布评论
评论(1)
确保将该对象标记为 [Serialized]。
Ensure you mark the object as [Serializable].