StateServer 不允许将 WCF 返回类型存储在会话变量中

发布于 2024-08-31 03:58:18 字数 279 浏览 0 评论 0原文

我正在从 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

输什么也不输骨气 2024-09-07 03:58:18

确保将该对象标记为 [Serialized]。

Ensure you mark the object as [Serializable].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文