启用 IIS 可选功能 IIS-ASPNET 和 IIS-NetFxExtensibility 时出错

Error while enabling IIS optional feature IIS-ASPNET and IIS-NetFxExtensibility

我无法启用可选功能 IIS-ASPNET 和 IIS-NetFxExtensibility。当我 运行 在 powershell 上执行命令以启用功能时

Enable-WindowsOptionalFeature -Online -FeatureName "IIS-NetFxExtensibility" -All
Enable-WindowsOptionalFeature -Online -FeatureName "IIS-ASPNET" -All

我遇到以下错误

Enable-WindowsOptionalFeature : The source files could not be downloaded.
Use the "source" option to specify the location of the files that are required to restore the feature. For more
information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName "IIS-ASPNET" -All
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand

您需要确保机器连接网络,否则无法安装成功。或者下载新的批量许可媒体。

You can't install features in Windows Server 2012 R2

Method 1: Connect to the Internet ­If the server can connect to Windows Update for the feature installation, let the server make the connection.

Method 2: Use Windows Server 2012 R2 installation media If the server can't connect to Windows Update, download the new Volume Licensing media (released on December 11, 2013) and use the Install-WindowsFeature PowerShell command.