4

Is it possible to temporarily and selectively disable one or more versions of the .NET Framework installed on a computer without actually uninstalling each one? The need is to check the effect on programs when certain versions of the framework are not available.

DavidRR
  • 18,291
  • 25
  • 109
  • 191
bobbyalex
  • 2,681
  • 3
  • 30
  • 51

2 Answers2

4

That's largely a loud "NO". .NET versions overwrite each other. Ignoring the ancient .NET 1.x versions, you can only ever have two distinct versions of .NET on a machine. Either one of older versions covered by CLR version 2.0.50727 (2.0, 3.0, 3.5, 3.5SP1) and one covered by CLR version 4.0.30319 (4.0, 4.01, 4.02, 4.03, 4.5, 4.5.1, 4.5.2, 4.6).

You cannot reliably go back to an older version within a CLR branch without doing significant damage to the machine. You'd have to uninstall the current version before you can start installing the one you want to test. This of course risks destabilizing existing programs on the machine, Visual Studio being a prime example. And it can be actively blocked; a Windows 8 machine for example will not allow you to uninstall 4.5 and prevents installing anything older than 3.5SP1.

You must use a separate machine or a VM to test this, one that boots an older version of Windows. The combination of Windows and .NET versions is unpleasantly large. Therefore, state in your System Requirements only what you are willing to support.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
1

It is not possible as far as I know. We have done similar things by using virtual machines with different snapshots with the .NET Framework versions we want to check.

You can automate the VMware machines with an SDK to make the whole process automatic.

DavidRR
  • 18,291
  • 25
  • 109
  • 191
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207