Windows 8.1中包含.NET Framework,操作系统安装过程中默认安装 .NET Framework 4.5.1。如果程序需要.NET Framework 3.5支持,将自动启用相关功能。
注意:
a. .NET Framework 3.5同时支持基于 .NET Framework 2.0/3.0/3.5构建应用程序。
b. 在安装Windows语言包之前,需要首先安装.NET Framework 3.5。
c. .NET Framework 3.5不再提供Windows CardSpace。
1.1. Win+X选择命令提示符(管理员模式)。
1.2. 加载安装镜像,本例中安装镜像加载至d盘,则安装源位于d:\sources\sxs,输入如下命令:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
/Online 指定在正在运行的操作系统中启用相关功能
/Enable-Feature /FeatureName:NetFx3 指定启用.NET framework 3.5
/All 启用.NET framework 3.5的所有父功能
/LimitAccess 阻止DISM与Windows Update连接
/Source 指定需要启用功能的位置(windows 8.1系统安装光盘位置)
/以下为操作记录///
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Windows\system32>DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /Limit
Access /Source:I:\sources\sxs
Deployment Image Servicing and Management tool
Version: 6.3.9600.16384
Image Version: 6.3.9600.16384
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
C:\Windows\system32>
///以上为操作记录//
1.3 此时,回到“控制面板启用.NET Framework 3.5”
打开控制面板,点击“程序”,选择“启用或关闭Windows功能”,发现Microsoft .NET Framework 3.5已经选中。
官方解决方案///
To enable .NET Framework 3.5 on only test machines with clean installs of Windows 8:
1.Copy \sources\sxs\ from the mounted operating system build ISO image to dotnet35 or similar folder. For example:
xcopy e:\sources\sxs\*.* c:\dotnet35 /s
2.Execute this command line using admin privileges:
Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:c:\dotnet35 /LimitAccess
Note The sources\SxS folder must not be used as a redistribution mechanism since this is not a supported mechanism.
///官方解决方案
1.4 以下为网友的提示和建议
解压ISO到根目录比如F盘,或挂载iso
输入如下命令:dism.exe /online /enable-feature /featurename:NetFX3 /Source:F:\sources\sxs (F为盘符),确保语言为系统安装默认时的语言
.net framework3.5安装
之前在很多地方找了教程,结果都失败了,包括论坛分享的运行库大全也没有用
后来是在微软的提示下成功安装的
具体方法就是先挂载win8.1的镜像(安装系统的那个)
然后管理员权限运行cmd(左下角右键可以看到)
在上面输入
Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess
======================================================================================
官方网址:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh848079(v=vs.85).aspx
.NET Framework 4.5 is default and .NET Framework 3.5 is optional
Platforms
Clients – Windows 8
Servers – Windows Server 2012
Description
.NET Framework 4.5 is enabled by default in Windows 8. Windows 8 does not include .NET 3.5 by default, but the files for .NET 3.5 are available on the Windows 8 installation media as an optional feature.
If the user is upgrading from Windows 7 to Windows 8, .NET Framework 3.5 is fully enabled to ensure that any apps on the computer continue to work correctly.
Manifestation
If the user performs a clean installation of Windows 8, and then installs apps that require .NET Framework 3.5 (or 2.0), they will trigger a request for the necessary .NET 3.5 files. Normally the missing files will be downloaded from Windows Update (after asking the user for permission), but if access to Windows Update is not possible, enabling .NET Framework 3.5 will fail unless an alternate source for the missing files has been specified.
Mitigation
To enable .NET Framework 3.5 on only test machines with clean installs of Windows 8:
- Copy \sources\sxs\ from the mounted operating system build ISO image to dotnet35 or similar folder. For example:
xcopy e:\sources\sxs\*.* c:\dotnet35 /s
- Execute this command line using admin privileges:
Copy
Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:c:\dotnet35 /LimitAccess
Note The sources\SxS folder must not be used as a redistribution mechanism since this is not a supported mechanism.
Solution
For consumers:
Windows 8 includes a mechanism that automatically enables .NET Framework 3.5 when attempting to install the redistributable package or when an application installer that needs .NET 3.5 invokes the redistributable.
For App developers (and IT Administrators):
IT administrators can configure .NET 3.5 apps to run on either .NET 3.5 or .NET 4.5 (depending on what's already installed). In order to run a managed app on either 3.5 or 4.5, just add a section in the application configuration file. This will ensure that if .NET 3.5 is installed, the app will run on .NET 3.5; otherwise the app will run on .NET 4.5. An example of the additional section in the configuration file is provided below:
For enterprise OEMs:
To enable .NET Framework 3.5 for EEAP builds and for applications that do not have access to Windows Update:
- Copy \sources\sxs\ from the mounted OS build ISO image to the dotnet35 or similar folder. For example:
Copy
xcopy e:\sources\sxs\*.* c:\dotnet35 /s
- Set the regkey:
Copy
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing] “LocalSourcePath”=”c:\dotnet35”
For enterprises:
For machines that are configured to use WSUS for servicing, you can set a registry entry to allow the machine to use Windows Update for enabling .NET 3.5 instead of WSUS (servicing will still be done from WSUS if you do this).
- Set the regkey:
Copy
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing] “RepairContentServerSource”=DWORD(2)
This registry entry can also be set via Group Policy (Local Computer Policy -> Computer Configuration -> Administrative Templates -> System. Select the setting “Specify settings for optional component installation and component repair”.
If you select “Contact Windows Update directly to download repair content instead of Windows Server Update Services (WSUS)”, any attempts to add Windows features (for example, .NET Framework 3.5) or repair features will trigger file downloads from Windows Update. Target computers require Internet and WU access for this option. Normal servicing operations continue to use WSUS if it has been configured as a source.
A note regarding setting local source location via registry entries
IT administrators can set local source location(s) for .NET 3.5 files via a registry entry, so that users can use the Add/Remove Windows Features dialog to enable features with missing payload without having to specify a source location. The value of the registry entry can be controlled via group policy.