2013-05-13 84 views
6

正如几个问题(Alternative for the Registering ASP.NET 4.5 on Windows Server 2012; Server 2012 IIS 8 MVC app shows default IIS home page or 403/404 errors; WCF on IIS8; *.svc handler mapping doesn't work)文件,在Windows服务2012 aspnet_regiis -ir命令不工作了,而是产生以下的输出:什么是Windows Server 2012命令行相当于`aspnet_regiis -ir`?

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 .

在我们的例子中,我们只需要运行此命令重新注册ASP.NET 4.5,因为其他安装未注册它:ASP.NET 4.5已安装。

使用UI(添加/删除角色/功能),受到引用帖子的启发,我发现只需删除WCF的HTTP激活功能并再次添加即可。 (但我需要卸载/重新安装恰好依赖于WCF HTTP激活的功能......)

问题:在Windows Server 2012上如何通过命令行完成同样的事情?

(我看着这个dism.exe东西,但它看起来令人生畏,而dism.exe -?没有帮助我的人。)

谢谢!

回答

0

您需要使用服务器管理器仪表板来添加/删除角色/功能。 查找IIS - > Web服务器 - >应用程序开发 - > ASP.NET 4.5

+1

是不是真正的问题... – 2014-04-04 07:04:41

+1

他提到,他已经能够做到这一点。他正在寻求一种替代使用aspnet-regiis的命令行。这个答案是无关紧要的! – 2017-12-12 07:54:46

4

复制Dism会做到这一点的最好办法:

Dism /online /Disable-Feature /FeatureName:WCF-HTTP-Activation45 
Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation45 

使用/所有交换机能够使当所有父母功能。

1

当您安装.NET 3.5 over CLR 2.0的.NET框架核心功能(包括已安装.NET Framework 4.5版本的Windows 2012或2012 R2服务器上的HTTP激活)时,似乎会发生此错误。

在我们的情况下,建议的修复程序不起作用。

我们有一个CLR 4.0网站,是显示错误:

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 

删除并重新添加ASP.NET 4.5的功能没有什么区别。

我们不得不删除,并使用DISM重新添加3.5功能:

Dism /online /Disable-Feature /FeatureName:WCF-HTTP-Activation 
Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation 

你也可以使用PowerShell:

Remove-WindowsFeature -Name NET-HTTP-Activation 
Add-WindowsFeature -Name NET-HTTP-Activation