다음을 통해 공유


.NET: Installation Windows Server 2012, 2012 R2, Windows 8, and 8.1

Overview

In this post, we talk about Dot Net 3.5 installation in several Windows versions.

In Server 2012 or 2012 R2

  1. Find and remove these 3 hot-fixes in Control panel: KB2966826, KB2966827, KB2966828
  2. Pop in the Windows DVD media, and install DOT NET 3.5 from the Server Manager -> Add Roles and Features

In Windows 8 or 8.1

  1. Find and remove these 3 hot-fixes in Control panel: KB2966826, KB2966827, KB2966828

  2. Pop in the Windows DVD media, and run the command 

    Dism.exe /online /enable-feature /featurename:netfx3 /source:d:\sources\sxs /all
    

Ways To Install

Windows Server 2012, 2012 R2, Windows 8, and 8.1 come with DOT NET 4 or 4.5 but not 3.5. DOT NET 3.5 came with Server 2008, 2008 R2, and Windows 7. It was easily installed as a standalone executable. A lot of older applications need DOT NET 3.5 to run.

With Server 2012/Windows 8 and up, we cannot just install DOT NET 3.5 from the executable. That errors out.

In Server 2012 and up, we're supposed to install roles and features from Server Manager -> Add Roles and Features:

First, go to control panel/uninstall a program/View installed updated, and remove any of these updates if you find them:

  • KB2966826
  • KB2966827
  • KB2966828

or, use this Powershell script:

$RemoveMe = "KB2966826","KB2966827","KB2966828"
$HotFixes = Get-HotFix | Sort HotFixID
 
Write-Host "Hotfixes installed on this system are:"  -ForegroundColor Green
$HotFixes.HotFixID
 
if ($HotFixes.HotFixID -in $RemoveMe) {
    Write-Host "Found matching Hotfixes:"  -ForegroundColor Yellow
    $HotFixes.HotFixID -match "KB296682"
} else {
    Write-Host "No matching Hotfixes Found"  -ForegroundColor Green
}
<# 
To remove:
 
$HotFixes | % {
    if ($_.HotFixID -in $RemoveMe) {
        "Removing Hotfix: $($_.HotfixId)"
        Invoke-Expression "wusa.exe /uninstall /kb:$($_.HotfixId.Replace('KB','')) /quiet /norestart"
    } 
}
 
#>

Note

Un-comment the lines at the bottom to remove.

Add DOT NET 3.5 as a feature:

That shows the warning that the media is missing:

Click "Specify an alternate source path"

Put the Windows DVD in drive D: and type in d:\sources\sxs

That's all.

In Windows 8 and above, we can use the DISM command to do the same:

Dism.exe /online /enable-feature /featurename:netfx3 /source:d:\sources\sxs /all

Again, d: is your DVD drive letter

See Also