打開管家婆母嬰版提示“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.”
[重要通告]如您遇疑難雜癥,本站支持知識付費業務,掃右邊二維碼加博主微信,可節省您寶貴時間哦!
今天閑來事兒不多,想測試一下管家婆母嬰版本,因為管家婆母嬰版需要用到IIS,安裝完以后,打開就直接顯示錯誤,錯誤如下;
Server Error in '/MY' 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 (0x80072749): 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) +2180324
System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +221
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +807
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
在上面的錯誤仔細看的話,不難看出問題,我還專門標注了一下 ASP.NET State service 其實就是這個服務的問題,我們直接啟動即可;
解決辦法:
1、啟動ASP.NET State service 方法:
開始--控制面板---所有控制面板項----管理工具---服務,找到ASP.NET State service?啟動即可;
2、mode="StateServer" 修改為 mode="InProc"方式方法;
打開站點目錄下的web.config文件,定位到配置節如下圖所示
<!--<sessionState timeout="600"/>-->
<sessionState mode="StateServer" stateNetworkTimeout="35" timeout="35" />
<!-- 默認值為 110秒,4096k -->
<httpRuntime executionTimeout="120" maxRequestLength="1024000" />
將 mode=“StateServer” 修改為 mode=“InProc” 即可;
問題未解決?付費解決問題加Q或微信 2589053300 (即Q號又微信號)右上方掃一掃可加博主微信
所寫所說,是心之所感,思之所悟,行之所得;文當無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!