解決方案一:
1. 開啟ASP.NET State Service服務:
選擇管理工具->服務,找到ASP.NET State Service,點開後選擇啟動,並將啟動類型設為自動。
2. 設定程式設定檔:
將web.config開啟,會看到有一行是<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" timeout="20"/>,如果沒有,請在<system.web>的下一行添加,再將其中的InProc改為StateServer,儲存即可。
解決方案:
如果按照方法一還不行出現如下錯誤:解決方案如下
錯誤描述:
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.
解決辦法
網上搜尋了半天,找到的相關答案都說是ASP.NET State Service服務沒有開啟,但伺服器上明明已經開啟了啊!就是因為殺毒軟體的問題,以前在另一台伺服器上裝了MCAFEE,開啟訪問保護ASP.NET的所有網站都會出錯,看了一下伺服器裡裝的NOD32,是把所有的功能都開啟了,關掉網路監視(IMON),驗證碼就可以正常顯示了