ASP.NET——"/"应用程序中的服务器错误

中文错误:

 

无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection 的值,确保服务器接受远程请求。如果服务器位于本地计算机上,并且上面提到的注册表值不存在或者设置为 0,则状态服务器连接字符串必须使用“localhost”或“127.0.0.1”作为服务器名称。  
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。  

异常详细信息: System.Web.HttpException: 无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection 的值,确保服务器接受远程请求。如果服务器位于本地计算机上,并且上面提到的注册表值不存在或者设置为 0,则状态服务器连接字符串必须使用“localhost”或“127.0.0.1”作为服务器名称。

源错误:  

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。   

堆栈跟踪:  


[HttpException (0x80072749): 无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection 的值,确保服务器接受远程请求。如果服务器位于本地计算机上,并且上面提到的注册表值不存在或者设置为 0,则状态服务器连接字符串必须使用“localhost”或“127.0.0.1”作为服务器名称。]

 

 

 

 

 

英文错误:

 

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_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server  is  on the local machine, and  if  the before mentioned registry value does not exist or  is   set  to  0 , then the state server connection  string  must use either  ' localhost '  or  ' 127.0.0.1 '   as  the server name. 
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_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server  is  on the local machine, and  if  the before mentioned registry value does not exist or  is   set  to  0 , then the state server connection  string  must use either  ' localhost '  or  ' 127.0.0.1 '   as  the server name.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified 
using  the exception stack trace below.  

Stack Trace: 


[HttpException (
0x8007274d ): 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_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server  is  on the local machine, and  if  the before mentioned registry value does not exist or  is   set  to  0 , then the state server connection  string  must use either  ' localhost '  or  ' 127.0.0.1 '   as  the server name.]
   System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults
&  results)  + 1565
   System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) 
+ 192
   System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) 
+ 355
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
+ 92
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean
&  completedSynchronously)  + 64

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:
2.0 . 50727.42 ; ASP.NET Version: 2.0 . 50727.42  

 

 

 

解决方法:

 

 

1、我的电脑-》服务-》启动 asp.net State (asp.net 状态服务)

或者 

2、Web.config設定:

以下是範例的設定給您參考,關於State Server的Port,預設值是 42424,如果您想要修改的話,請您找到以下的機碼值:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\Port 直接修改成您要的數字,並且在對應的Web.config中修改掉。

<configuration>
  <system.web>
    <sessionState mode="StateServer"
      stateConnectionString="tcpip=SampleStateServer:42424"
      cookieless="false"
      timeout="20"/>
  </system.web>
</configuration>

3、删掉web.config 中上面的配置串。这样 session 就绑定在iis 进程中。而不是状态服务

 

 

 

转载于:https://www.cnblogs.com/adaasafod/archive/2010/07/21/1782420.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值