如何在 Windows 10 上使用 IIS8 注册 .Net 4.5.1 [英] How to register .Net 4.5.1 with IIS8 on windows 10

查看:28
本文介绍了如何在 Windows 10 上使用 IIS8 注册 .Net 4.5.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Windows 10 机器上使用 IIS8 注册 .Net 4.5.1?它曾经很简单,就像运行命令aspnet_regiis -i"一样……但现在不是了.如果尝试运行此命令,我会收到错误

<块引用>

此版本的操作系统不支持此选项.管理员应该使用 IIS8 安装/卸载 ASP.NET 4.5使用打开/关闭 Windows 功能"对话框,服务器管理器管理工具,或 dism.exe 命令行工具.更多细节请参阅

解决方案

您可以使用 dism 工具启用 Windows 内置的功能.要将 .NET 4.5(或 4.6,它们是相同的,因为它下面是相同的 CLR4)到 IIS 中,我认为这会起作用:

dism/online/enable-feature/featurename:IIS-ASPNET45/all

/all 标志将包含任何依赖项,因此您不必全部弄清楚.

您还可以通过运行以下命令查看所有可用功能:

dism/online/get-features

顺便说一句,当您需要将某个版本的 CLR 安装到 IIS 中时,会使用 aspnet_regiis.由于 .NET 4.0 之后的所有版本都使用相同的 CLR 版本,因此现在已将其内置到 Windows 功能中.因此,您改用 DISM 来启用该功能.

How to register .Net 4.5.1 with IIS8 on windows 10 machine? it used to be simple as running command "aspnet_regiis -i"...but not anymore. if try to run this command i get error

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).

Also in windows 10 under "Turn windows feature on & off" windows why i dont see .net 4.5 or 4.5.1? i do see 4.6 though. Is it same as 4.5.1?
(note i am sure 4.5.1 is installed on my machine because visual studio allows me to set target framework 4.5.1 on web applications and i have several applications which runs on 4.5.1 without any issue)

解决方案

You can use the dism tool to enable features built into Windows. To install .NET 4.5 (or 4.6, they're the same since it's the same CLR4 underneath) into IIS, I think this will work:

dism /online /enable-feature /featurename:IIS-ASPNET45 /all

The /all flag will include any dependencies so you don't have to figure them all out.

You can also see all of the available features by running:

dism /online /get-features

As an aside, aspnet_regiis was used when you needed to install a version of the CLR into IIS. Since all versions of .NET since 4.0 use the same CLR versions, this is now built into the Windows features. So you use DISM to enable the feature instead.

这篇关于如何在 Windows 10 上使用 IIS8 注册 .Net 4.5.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆