asp.net - 什么是相当于 `aspnet_regiis -ir` 的 Windows Server 2012 命令行?

标签 asp.net asp.net-4.5 iis-8 windows-server-2012

正如几个问题( Alternative for the Registering ASP.NET 4.5 on Windows Server 2012Server 2012 IIS 8 MVC app shows default IIS home page or 403 / 404 errorsWCF 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/

相关文章:

.net - ASP.NET MVC 3 动态控件

asp.net - 用于应用 Entity Framework 迁移的 PowerShell?

c# - 通过异步/等待的服务器通信?

c# - ASP.NET 在每次请求时重新编译

Owin 托管的 NancyFX 应用程序在发布到 IIS 后返回无法加载类型 Nancy.Hosting.Aspnet.NancyHttpRequestHandler

security - ServerManager.OpenRemote 的凭据

asp.net - ASP.NET MVC/WebApi 的 Azure 表存储最佳实践

c# - 如何通过 C# 将可空整数列的空值插入 SQL 表

.net - 如何调试: Multiple assemblies with equivalent identity have been imported?

javascript - div被隐藏但又出现了