使用部署映像服务和管理 (DISM) 部署 .NET Framework 3.5Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM)

可使用部署映像服务和管理 (DISM) 命令行工具创建修改后的映像以部署 .NET Framework 3.5。You can use the Deployment Image Servicing and Management (DISM) command-line tool to create a modified image to deploy .NET Framework 3.5.

重要

对于将支持多种语言的映像,必须在添加任何语言包之前先添加 .NET Framework 3.5 二进制文件。For images that will support more than one language, you must add .NET Framework 3.5 binaries before adding any language packs. 此顺序可确保 .NET Framework 3.5 语言资源已正确安装在引用映像中,且可供用户和应用程序使用。This order ensures that .NET Framework 3.5 language resources are installed correctly in the reference image and available to users and applications.

通过 Internet 连接使用 DISMUsing DISM with Internet connectivity

要求Requirements

对于可访问 Windows 更新的联机引用映像For an online reference image that can access Windows Update

  1. 使用 Windows 8 或 Windows Server 2012 中的管理员用户权限(以管理员身份运行)打开命令提示符。Open a command prompt with administrator user rights (Run as Administrator) in Windows 8 or Windows Server 2012.

  2. 若要从 Windows 更新安装 .NET Framework 3.5 功能文件,请使用以下命令:To Install .NET Framework 3.5 feature files from Windows Update, use the following command:

    DISM /Online /Enable-Feature /FeatureName:NetFx3 /All 
    

    使用“/All”启用指定功能的所有父功能 。Use /All to enable all parent features of the specified feature. 有关 DISM 参数的详细信息,请参阅使用 DISM 启用或禁用 Windows 功能For more information on DISM arguments, see Enable or Disable Windows Features Using DISM.

  3. 安装完成后,在 Windows 8 电脑上,.NET Framework 3.5 在控制面板中的“打开或关闭 Windows 功能”中显示为“已启用”。On Windows 8 PCs, after installation .NET Framework 3.5 is displayed as enabled in Turn Windows features on or off in Control Panel. 对于 Windows Server 2012 系统,可在服务器管理器中查看功能安装状态。For Windows Server 2012 systems, feature installation state can be viewed in Server Manager.

对于脱机引用映像For an offline reference image

  1. 运行以下 DISM 命令(装载到“c:\test\offline”文件夹的映像和“D:\drive”中的安装介质)以安装 .NET 3.5:Run the following DISM command (image mounted to the c:\test\offline folder and the installation media in the D:\drive) to install .NET 3.5:

    DISM /Image:C:\test\offline /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:D:\sources\sxs
    

    使用“/All”启用指定功能的所有父功能 。Use /All to enable all parent features of the specified feature.

    使用“/LimitAccess”阻止 DISM 与 Windows 更新/WSUS 联系 。Use /LimitAccess to prevent DISM from contacting Windows Update/WSUS.

    使用“/Source”指定还原功能所需的文件的位置 。Use /Source to specify the location of the files that are needed to restore the feature.

    若要使用 Windows ADK 安装中的 DISM,请找到 Windows ADK 服务文件夹,并导航到此目录。To use DISM from an installation of the Windows ADK, locate the Windows ADK servicing folder and navigate to this directory. 默认情况下,DISM 安装在“C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools”\中。By default, DISM is installed at C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\. 可通过 Windows ADK 在另一个支持的操作系统上安装 DISM 及其他部署和映像工具,如 Windows 系统映像管理器 (Windows SIM)。You can install DISM and other deployment and imaging tools, such as Windows System Image Manager (Windows SIM), on another supported operating system from the Windows ADK. 有关 DISM 支持的平台的信息,请参阅 DISM 支持的平台For information about DISM-supported platforms, see DISM Supported Platforms.

  2. 运行以下命令以查找 .NET Framework 3.5 的状态(装载到“c:\test\offline”的脱机映像):Run the following command to look up the status of .NET Framework 3.5 (offline image mounted to c:\test\offline):

    DISM /Image:c:\test\offline /Get-Features /Format:Table
    

    如果状态为“启用挂起”,则必须将映像联机才能完成安装 。A status of Enable Pending indicates that the image must be brought online to complete the installation.

在没有 Internet 连接的情况下使用 DISMUsing DISM with no Internet connectivity

可使用 DISM 添加 .NET Framework 3.5,并提供对安装介质上的“\sources\SxS”文件夹的访问权限,以安装未连接到 Internet 的 Windows。You can use DISM to add .NET Framework 3.5 and provide access to the \sources\SxS folder on the installation media to an installation of Windows that is not connected to the Internet.

警告

如果不依赖 Windows 更新作为安装 .NET Framework 3.5 的源,请确保使用相同且对应的 Windows 操作系统版本中的源。If you're not relying on Windows Update as the source for installing the .NET Framework 3.5, make sure to use sources from the same corresponding Windows operating system version. 使用不对应于同一版本 Windows 的源路径不会阻止安装 .NET Framework 3.5 的不匹配版本。Using a source path that doesn't correspond to the same version of Windows won't prevent a mismatched version of .NET Framework 3.5 from being installed. 这可能导致系统陷入不受支持和无法服务的状态。This can cause the system to be in an unsupported and unserviceable state.

要求Requirements

  • Windows 8、Windows Server 2012 或 Windows ADK 工具。Windows 8, Windows Server 2012, or the Windows ADK tools.

  • 安装介质Installation media

  • 管理员用户权限。Administrator user rights. 当前用户必须是本地管理员组的成员才能添加或删除 Windows 功能。The current user must be a member of the local Administrators group to add or remove Windows features.

步骤Steps

  1. 使用管理员用户权限(以管理员身份运行)打开命令提示符。Open a command prompt with administrator user rights (Run as Administrator).

  2. 若要从位于“D:”驱动器上的安装介质安装 .NET Framework 3.5,请使用以下命令 :To install .NET Framework 3.5 from installation media located on the D: drive, use the following command:

    DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
    

    使用“/All”启用指定功能的所有父功能 。Use /All to enable all parent features of the specified feature.

    使用“/LimitAccess”阻止 DISM 与 Windows 更新/WSUS 联系 。Use /LimitAccess to prevent DISM from contacting Windows Update/WSUS.

    使用“/Source”指定还原功能所需的文件的位置 。Use /Source to specify the location of the files that are needed to restore the feature.

    有关 DISM 参数的详细信息,请参阅使用 DISM 启用或禁用 Windows 功能For more information on DISM arguments, see Enable or Disable Windows Features Using DISM.

安装完成后,在 Windows 8 电脑上,.NET Framework 3.5 在控制面板中的“打开或关闭 Windows 功能”中显示为“已启用”。On Windows 8 PCs, after installation, .NET Framework 3.5 is displayed as enabled in Turn Windows features on or off in Control Panel.

相关主题Related topics

Microsoft .NET Framework 3.5 部署注意事项Microsoft .NET Framework 3.5 Deployment Considerations