正如几个问题( 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 Service 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 -?
根本没有帮助我。)谢谢!
最佳答案
Dism 将是执行此操作的最佳方法:
Dism /online /Disable-Feature /FeatureName:WCF-HTTP-Activation45
Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation45
启用时使用/all 开关以启用所有父功能。
关于asp.net - 什么是相当于 `aspnet_regiis -ir` 的 Windows Server 2012 命令行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16524733/