服务中缺少 ASP.Net 状态服务

服务中缺少 ASP.Net 状态服务

在将 IIS 应用程序池中的 .Net 版本更改为 v4 并再次将其更改回 v3.5 后,ASP.net 状态服务似乎神秘地从我们的 Web 服务器的服务列表中消失了。我们甚至不确定这是否相关。

有人知道我们如何重新安装或以某种方式注册该服务吗?

这是在 Windows 2008 Server 上。已安装所有 .Net 版本。

谢谢

答案1

运行此命令已重新安装 ASP.Net 状态服务,会话状态现在又可以正常工作了。但仍不确定原始原因。

C:\Windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis -i

答案2

非常好的答案。我花了很多时间调试这个问题。我们的网站直到昨天都运行良好,然后突然出现错误并停止运行。

会话状态仅在配置文件或 Page 指令中设置为 true 时才可使用enableSessionState。还请确保应用程序配置中的部分System.Web.SessionStateModule中包含或自定义会话状态模块。<configuration>\<system.web>\<httpModules>

检查后发现服务列表中缺少 ASP.net 状态服务。

按照如下方法重新安装有助于解决问题。

C:\Windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis -i

答案3

运行时C:\Windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis -i 我得到:

C:\Users\mihai>C:\Windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis -i
Microsoft (R) ASP.NET RegIIS version 4.0.30319.0
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
Start installing ASP.NET (4.0.30319.0).
This option is not supported on this version of the operating system.  Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog,  the Server Manager management tool, or the dism.exe command line tool.  For more details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.0).

因此我使用“打开/关闭 Windows 功能”对话框来安装 IIS 和 ASP.NET 4.6。

请注意,必须在 .NET 之前安装 IIS。

相关内容