VS.Net2005 C#發布網站時為什么用StateServer報錯?

---涛声依旧--- 2007-06-18 05:43:18
在本機調試時,Web.Config中設置如下:
<compilation debug="true">
<sessionState mode="InProc"

而發布時,如下:
<compilation debug="false">
<sessionState mode="StateServer"

以前發布都時這樣,今天換服務器了,重新發布卻出錯了,ASP.Net State Server啟動了,檢查“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection”的值也為“1”
將mode="StateServer" 改為:“InProc”就可以了
請問為什么?發布時用InProc不好,Session容易丟失的,如何做?謝謝!
...全文
550 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
---涛声依旧--- 2007-07-21
  • 打赏
  • 举报
回复
問題還是沒有解決,請大家幫忙了。謝謝!
---涛声依旧--- 2007-07-17
  • 打赏
  • 举报
回复
42424端口沒有被占用啊
aspnet_state.exe 1396 0.0.0.0 42424 LISTEN TCP C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe

VS.Net2005 C#發布網站時為什么用StateServer報錯?
還有其他原因嗎?
cchaojie 2007-07-14
  • 打赏
  • 举报
回复
手动启动ASP.NET State Server服务
---涛声依旧--- 2007-07-14
  • 打赏
  • 举报
回复
这个我还没有查,下周一去查一下
必须要用42424端口吗?
amandag 2007-07-14
  • 打赏
  • 举报
回复
42424端口号是否被占用?
vainnetwork 2007-07-14
  • 打赏
  • 举报
回复
没遇到过,帮顶.楼下回答
蝶恋花雨 2007-07-14
  • 打赏
  • 举报
回复
没有遇到过帮你顶顶
---涛声依旧--- 2007-07-03
  • 打赏
  • 举报
回复
贴沉了
---涛声依旧--- 2007-06-21
  • 打赏
  • 举报
回复
没人知道吗?还是分太少了?
---涛声依旧--- 2007-06-20
  • 打赏
  • 举报
回复
有对应的stateConnectionString ,我发贴时只是省掉了

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60"/>

为什么发布时用mode="StateServer"会报错呢?
CathySun118 2007-06-20
  • 打赏
  • 举报
回复
设成StateServer 后,必须要有对应的stateConnectionString
---涛声依旧--- 2007-06-18
  • 打赏
  • 举报
回复
詳細錯誤信息如下:
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 (0x80072746): 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.210

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧