Add the .NET Framework 3.5 to a VHD or WIM File

Q: How do I add the .NET Framework 3.5 to my VHD or WIM file so it's locally available should I want to enable it in the future?

A: As you might know, in Windows Server 2012 and Windows 8 the .NET Framework 3.5 isn't locally available for installations. This is because of its size and because Windows 2012/Windows 8 have the new .NET Framework 4.0, so providing both used too much disk space.Instead, when .NET Framework 3.5 is enabled as a feature, it's either downloaded from Windows Update or you can specify a location such as a folder or WIM file as the source.

The easiest way to add the .NET Framework 3.5 to a (virtual hard disk) VHD file (that's perhaps a template for the creation of future virtual machines--VMs) is to just add the .NET Framework 3.5 feature, which will cause the files to be copied to the VHD; then disable the .NET 3.5 feature (which will leave the files locally available).

Run the Add Roles and Features Wizard as usual, but select the option to select a VHD from the Server Selection page, pick your VHD, then continue. After .NET Framework 3.5 is added, rerun the wizard in removal mode, select the same VHD, and remove the feature.

The screenshots below show the entire process. This could also be done with Windows PowerShell by using the Install-WindowsFeature and Remove-WindowsFeature cmdlets.

net35add1sml
Add Roles and Features Wizard

net35add2sml
Selecting Features in Add Roles and Features Wizard

net35add3sml
Installation Progress

net35add4sml
Removing .NET Framework

For a WIM file, using DISM is the best choice. In the example below, I mount the WIM file, then add .NET Framework 3.5 with the source being my local server's side-by-side assembly (which already has .NET Framework 3.5 installed using Features on Demand). Then I remove it straight away (which leaves the files in the WIM). Once it's removed, dismount the WIM by using  the commit option.

 

<code>PS D:\> dism /Mount-Wim /wimfile:d:\sources\install.wim /index:4 /mountdir:d:\temp\wimmount</code>
<strong> </strong><br><br>
Deployment Image Servicing and Management tool<br>
Version: 6.2.9200.16384<br><br>
Mounting image<br>
The operation completed successfully.<br><br>
PS D:\> <strong>dism /image:d:\temp\wimmount /enable-feature /featurename:NetFx3 /All /Source:c:\windows\winsxs</strong><br><br>
Deployment Image Servicing and Management tool<br>
Version: 6.2.9200.16384<br><br>
Image Version: 6.2.9200.16384<br><br>
Enabling feature(s)<br>
The operation completed successfully.<br><pre>PS D:\> dism /image:d:\temp\wimmount /disable-feature /featurename:NetFx3</pre>
<br>
Deployment Image Servicing and Management tool<br>
Version: 6.2.9200.16384<br><br>
Image Version: 6.2.9200.16384<br><br>
Disabling feature(s)<br>
The operation completed successfully.

 

<code>PS D:\> dism /Unmount-Wim /mountdir:d:\temp\wimmount /commit</code>
 <br>
Deployment Image Servicing and Management tool<br>
Version: 6.2.9200.16384<br><br>
Image File : d:\sources\install.wim<br>
Image Index : 4<br>
Saving image<br>
Unmounting image<br>
The operation completed successfully.

Please or Register to post comments.

Latest from the Blog
May 21, 2013
blog

The Big Deal about Big Data

Big Data is definitely one of the most important trends in IT today. Big Data is important because it enables organizations to derive new decision-making information from previously untapped data sources. Like Business Intelligence (BI) Big Data is all about making better and faster business decisions and gaining a competitive business advantage.  ...More
May 2, 2013
blog

Flash Storage Arrays and the Need for Speed

Flash storage has some tremendous performance advantages over traditional rotational drives. Recent advances in the capacities and corresponding reduction in costs of flash storage have opened up many new flash based enterprise options....More
ODX Windows Server 2012
Apr. 24, 2013
Sponsored

Digging Into Windows Server 2012 New Storage Features

Windows Server 2012 has several new storage features that help address today’s storage challenges and bring some of the capabilities that were traditionally only offered by SANs within the reach of smaller businesses, while at the same time offering improved integration with SAN storage....More
Mar. 29, 2013
Sponsored

Going Beyond Virtualization with the Private Cloud

Learn how the private cloud extends beyond virtualization...More

Are you using Virtual Desktop Infrastructure (VDI) technologies?