服务中缺lessASP.Net状态服务

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

有谁知道我们可以重新安装或以某种方式注册服务?

这是在Windows 2008服务器上。 所有.Net版本都已安装。

谢谢

运行此命令已重新安装了ASP.Net状态服务,并且会话状态现在再次正常工作。 仍然不确定原来的原因。

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

优秀的答案。 我花了很多时间debugging这个问题。 我们的网站一直工作到昨天,突然停止工作,错误。

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

当检查ASP.net状态服务从服务列表中缺less。

重新安装如下,有助于解决问题。

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

当运行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). 

所以我使用“打开/closuresWindowsfunction”对话框来安装IIS和ASP.NET 4.6。

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