在 SharePoint 2010 中启用会话状态?

发布于 2024-08-21 03:59:38 字数 918 浏览 4 评论 0原文

我有一个为 SharePoint 2007 构建的 Web 服务,我正在尝试将其移植到 SharePoint 2010。此 Web 服务依赖于会话状态才能正常运行,但到目前为止,我已经能够让会话状态在 SharePoint 2010 中正常工作该 Web 服务作为其自己的 Web 应用程序在 t 下运行。 /_vti_bin 虚拟目录。我已尝试以下所有方法,但没有成功:

  • 确保“State Service”服务应用程序正在运行。
  • System.Web.SessionState.SessionStateModule http 模块添加到我的应用程序的 web.config 文件中。
  • System.Web.SessionState.SessionStateModule http 模块添加到我的 SharePoint 根 web.config 文件中。
  • 添加到我的应用程序的 web.config 文件中。
  • 添加到我的根 web.config 文件中。

其他环境信息:

  • Visual Studio 2008 - SP1
  • .NET 3.5 - SP1
  • SharePoint 2010 - RC
  • Windows Server 2008 R2
  • ASMX Web 服务(不是 WCF)

有没有人有幸获得 Web 应用程序或 Web 服务来使用SharePoint 2010 中的会话状态还没有吗?

谢谢!

史蒂夫

I have a web service built for SharePoint 2007 that I am trying to port to SharePoint 2010. This web service is dependent on session state to function properly, but so far, I have been enable to get session state to work at all in SharePoint 2010. This web service runs as its own web application under t
he /_vti_bin virtual directory. I have tried all of the following with no luck:

  • Ensured the "State Service" service application is running.
  • Added the System.Web.SessionState.SessionStateModule http module to my application's web.config file.
  • Added the System.Web.SessionState.SessionStateModule http module to my SharePoint root web.config file.
  • Added <pages enableSessionState="true" /> to my application's web.config file.
  • Added <pages enableSessionState="true" /> to my root web.config file.

Additional Environment info:

  • Visual Studio 2008 - SP1
  • .NET 3.5 - SP1
  • SharePoint 2010 - RC
  • Windows Server 2008 R2
  • ASMX web service (not WCF)

Had anyone had any luck getting a web application or web service to use session state in SharePoint 2010 yet?

Thanks!

Steve

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

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

发布评论

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

评论(5

铁憨憨 2024-08-28 03:59:38

您已经在互联网上的其他地方亲自回答过这个问题。 :)

<httpModules> 
  <add name="Session" type="System.Web.SessionState.SessionStateModule" /> 
</httpModules>

然后,您必须进入您的 Web 应用程序并将相同的会话状态模块添加到 IIS7 托管管道中。

  1. 打开 IIS 7 管理器,找到您的 Web 应用程序。

  2. 双击 IIS 部分中的“模块”。

  3. 单击右侧窗格中的“添加托管模块...”。

  4. 在“添加托管模块”对话框中,输入“SessionState” 或类似名称作为名称,然后从下拉列表中选择以下项目:

    <块引用>

    System.Web.SessionState.SessionStateModule、System.Web、版本=2.0.0.0、文化=中性、PublicKeyToken=b03f5f7f11d50a3a

之后,应该为您的 Web 应用程序/Web 服务启用会话状态!

You've already answered this yourself somewhere else on the interweb. :)

<httpModules> 
  <add name="Session" type="System.Web.SessionState.SessionStateModule" /> 
</httpModules>

THEN, you must go into your web application and add the same session state module to the IIS7 managed pipeline.

  1. Open IIS 7 manager, and find your web application.

  2. Double click "Modules" in the IIS section.

  3. Click "Add Managed Module..." on the right hand pane.

  4. In the Add Managed Module dialog, enter "SessionState" or something like that for the name, and choose the following item from the dropdown:

    System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

After that, session state should be enabled for your web app/web service!

谁许谁一生繁华 2024-08-28 03:59:38

您可能需要打开会话状态服务。使用 PowerShell cmdlet Enable-SPSessionStateService。这将创建一个会话状态数据库并在 SharePoint 2010 中启动该服务。

参考信息:
http://technet.microsoft.com/en-us/library/ee890113.aspx

You may need to turn on the Session State Service. Use the PowerShell cmdlet Enable-SPSessionStateService. This will create a Session State database and start the service in SharePoint 2010.

Reference information:
http://technet.microsoft.com/en-us/library/ee890113.aspx

顾忌 2024-08-28 03:59:38

Joshua 的解决方案帮助我指明了正确的方向,但我必须针对我的场景做出一些变化 - 部署到 _layouts 文件夹的 ASP.NET 3.5 网站。

以下是对我有用的步骤:

  1. 将网站 web.config 中的 标记更改为

  2. 在 Sharepoint 网站级别(不是整个 IIS 级别)添加了 System.Web.SessionState.SessionStateModule 模块 - 这会破坏管理中心,我按照 @Joshua 的解决方案尝试了 :( )如果您要部署 Web 应用程序而不是网站,则需要在 Web 应用程序级别添加它。

将下面的 SessionState HTTPModule 添加到 web.config 似乎对我没有影响,可能是因为我使用的是 Sharepoint 的 web.config,因为我的项目是一个网站而不是 Web 应用 。对于这个问题还不是太清楚。

<httpModules> 
    <add name = "Session" type = "System.Web.SessionState.SessionStateModule" /> 
</httpModules>

Joshua's solution helped point me in the right direction but I had to make some variations for my scenario - an ASP.NET 3.5 Web Site deployed to the _layouts folder.

Here are the steps that worked for me:

  1. changed the <pages> tag in the web.config for the Web Site to <pages enableSessionState="true" />

  2. Added the System.Web.SessionState.SessionStateModule module at the Sharepoint website level (not the entire IIS level - that'll break the Central Administration, I tried :( ) as per @Joshua's solution. If you're deploying a Web Application instead of a Web Site, you'll want to add it at your Web Application level.

Adding the SessionState HTTPModule below to the web.config didn't seem to have an effect for me, probably because I was riding on Sharepoint's web.config as my project was a Web Site and not a Web Application. Not too clear on this issue.

<httpModules> 
    <add name = "Session" type = "System.Web.SessionState.SessionStateModule" /> 
</httpModules>
过期以后 2024-08-28 03:59:38

如下所示:

 <modules runAllManagedModulesForAllrequests>
   <add name="Session" type="System.Web.SessionState.SessionStateModule" />
 </modules>

modules 是一个 xml 标签。我不知道为什么,这篇文章没有使用 xml 标签..

谢谢

卡罗尔

Do like below:

 <modules runAllManagedModulesForAllrequests>
   <add name="Session" type="System.Web.SessionState.SessionStateModule" />
 </modules>

modules is an xml tag. I don't know why, this post is not taking xml tags..

Thanks

Carol

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