zoukankan      html  css  js  c++  java
  • ASP.NET State Server 服务 sessionState

    在发布ASP.NET网站的时候,出现state server错误:
    Server Error in '/' Application.
    --------------------------------------------------------------------------------
      Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection. 
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
      Exception Details: System.Web.HttpException: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection.
    出现这种错误的原因,一般可以归纳为一下几点:
    1、ASP.NET State Server 服务关闭了,开启即可。
         ASP.NET State Server服务默认是手动开启的, 所以很多时候在服务器重启后,ASP.NET State Server 服务其实是停止状态的,最好将该服务设成自动启动。
    2、HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection的值不为1,确保服务器能接受远程请求。
        AllowRemoteConnection 的键值设置成“1”后,意味着允许远程电脑的连接,也就是说只要知道你的服务端口,就可享用你的ASP.NET State Service,即把 Session 存放在服务器进程内,但这样会导致安全性减弱。
    3、42424端口被其他程序占用或者没有开启,因为42424端口是将session存在服务器进程必须的。
    4、设成StateServer 后,必须要有对应的stateConnectionString 。
         Web.config中<sessionState> 节点内容应该设置成类似下面内容:
         <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="300"/>

  • 相关阅读:
    Python爬虫入门教程 53-100 Python3爬虫获取三亚天气做旅游参照
    计算机大专学历,2019如何应届毕业薪水过万!
    Python爬虫入门教程 52-100 Python3爬虫获取博客园文章定时发送到邮箱
    Python爬虫入门教程 51-100 Python3爬虫通过m3u8文件下载ts视频-Python爬虫6操作
    Python爬虫入门教程 50-100 Python3爬虫爬取VIP视频-Python爬虫6操作
    nvm-windows
    如何进行 IIS Log 分析
    常用 Jenkins 配置
    Jenkins 插件安装问题
    常用 SQL Server 脚本
  • 原文地址:https://www.cnblogs.com/szytwo/p/4804008.html
Copyright © 2011-2022 走看看