Starting from Windows 8 and Windows Server 2012, the .Net 4 gets installed by default along with the OS. For some applications, especially those that need to register a service, .Net 3.5 is required. I got the installation error while installing the AppDynamics Controller on Windows Server 2016 due to the missing .Net 3.5 framework.
There are many ways to install .Net 3.5 such as via Adding Roles & Features (if it’s Windows Server) or directly from an EXE file. Surprisingly, when I tried both of those ways, the installation failed telling couldn’t reach the Microsoft web site. If you don’t have an Internet connection like I do at office, you can still install the .Net 3.5 framework directly from the Windows installation DVD or the corresponding ISO file. This is similar to installing an RPM package on RHEL from the installation DVD or its ISO image.
Follow these steps to install the .Net 3.5 framework from a Windows Server 2012/2016 ISO image file:
Step #1: Insert the installation disk or Mount the ISO file
If you’ve the installation disc of Windows Server 2012 or 2016, insert it. If all you have is the iso image file, right-click on the file and select the Mount option from the context menu.
Make sure the mounted disc or the ISO image is visible in the Windows Explorer.
Step #2: Run the DISM command to install .Net 3.5 from the source files
At an elevated command prompt, run the following command:
dism /online /enable-feature /featurename:NetFx3 /All /Source:<drive>:\sources\sxs /LimitAccess
Replace the “<drive>:” with the appropriate drive letter of the mounted volume that contains the OS source files. In my case, it’s
F:. Don’t forget the colon
: after the drive letter.
DISM stands for Deployment Image Servicing and Management. It’s a command-line utility to install, uninstall, configure, and update the features using Windows OS images. A subset of the command options are available for servicing a running (online) operating system.
Step #3: (Optional) Check the installed .Net frameworks
You can verify the version of all the .Net frameworks installed from the command line by running the following
dir (directory listing) command:
dir %windir%\Microsoft.NET\Framework /AD
Note: Only Windows Server 2012 &2016 contains .Net 3.5 framework executable. Windows 7, 8 or 10 don’t. Use the server iso image when installing the .Net framework and not the desktop version of Windows.