无法向会话状态服务器发出会话状态请求。

原因分析:
web.config中配置SessionState的mode为StateServer,但服务器没有开启改个服务。

解决方法:
1.Web.Config里面 把sessionState 的mode改为"InProc"   ;

Web.Config里面:   
  <sessionState     
                          mode="InProc"   
                          stateConnectionString="tcpip=127.0.0.1:42424"   
                          sqlConnectionString="data   source=127.0.0.1;user   id=sa;password="   
                          cookieless="false"     
                          timeout="20"     
          />   
  你是不是使用“StateServer”,如果是,请参考:   
  使用   StateServer   模式     
    
  确保   ASP.NET   状态服务正在将存储会话状态信息的远程服务器上运行。该服务是随   ASP.NET   Premium   版一起安装的,并且该服务默认情况下位于   <Drive>:Program   FilesASP.NETPremiumversionaspnet_estate.exe。     
  在应用程序的   Web.config   文件中,设置   mode=StateServer   并设置   stateConnectionString   属性;例如   stateConnectionString="tcpip=sarath:42424"。

或者
2.在服务中启用"ASP.NET State service"

在"管理工具"中的"服务"启动"ASP.NET   State   Service",这种方法我自己试了,能解决问题的。

参考地址:

http://www.cnblogs.com/lcl_1015/articles/2038103.html

 

 

 

ASP.NET session state supports several different storage options for session data. Each option is identified by a value in the SessionStateMode enumeration. The following list describes the available session state modes:

  • InProc mode, which stores session state in memory on the Web server. This is the default.

  • StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

  • SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

  • Custom mode, which enables you to specify a custom storage provider.

  • Off mode, which disables session state.

  • ASP.NET会话状态支持会话数据的几个不同的存储选项。每一个选项是在sessionstatemode枚举值确定。下面的列表描述了可用的会话状态模式:

    inproc模式,它存储会话状态存储在Web服务器。这是默认的。

    StateServer会话状态模式,它存储在一个单独的过程称为ASP.NET状态服务。这保证了会话状态是在重新启动Web应用程序时,也使会话状态可用于多个Web服务器在Web场保存。

    SQLServer存储会话状态模式,在SQL Server数据库。这保证了会话状态是在重新启动Web应用程序时,也使会话状态可用于多个Web服务器在Web场保存。

    自定义模式,使您可以指定一个自定义存储提供商。

原文地址:https://www.cnblogs.com/Ann-wxp/p/3596186.html