The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM) instead of Chocolatey and some notes on PowerShell colours

Posted by jpluimers on 2025/01/07

Since every now and then, like testing software developed with older tools, you need to run older software.

This always works: [Wayback /Archive] Deploy .NET Framework 3.5 by using Deployment Image Servicing and Management (DISM) | Microsoft Learn

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

Use /All to enable all parent features of the specified feature.

(The /All is needed because software requiring .NET Framework 3.5 also require the parent features).

Notes:

  • Tested on Windows 10 and Windows 11 in 2022.
  • It can take a really long time (more than just a few minutes!) even on fast connections.
  • Installing through Chocolatey with `choco install dotnet3.5 fails on Windows 11 (have not tried on Windows 10) with the classical red on black PowerShell default error theme*:

    ERROR: The term 'wmic' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    The install of DotNet3.5 was NOT successful.
    Error while running 'C:\ProgramData\chocolatey\lib\DotNet3.5\Tools\ChocolateyInstall.ps1'.

You can check the installed .NET frameworks before/after this action. On a newly installed Windows 11 system, these were:

PS C:\Users\jeroenp> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version

PSChildName Version
----------- -------
Client      4.8.09032
Full        4.8.09032
Client      4.0.0.0


PS C:\Users\jeroenp> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version

PSChildName                      Version
-----------                      -------
v2.0.50727                       2.0.50727.4927
v3.0                             3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation  3.0.6920.4902
v3.5                             3.5.30729.4926
Client                           4.8.09032
Full                             4.8.09032
Client                           4.0.0.0

Script from [Wayback/Archive] How to manage .NET Framework on Windows 10 & 11 | PDQ (I forgot how I bumped into this, but I luckily kept a note I did).

PowerShell colours

  • this was even worse in older PowerShell versions, and yes you can change the PowerShell red on black default error theme:

PowerShell colors and their combinations:

Queries:

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.