If you have a .NET 2.0, 3.0, or 3.5 desktop app (WinForms/WPF) that you want to run on Windows 8.0 and later where .NET Framework 3.5 is not preinstalled, it makes sense to add the following to your app.config file:
so that your app would just run, without a user having to enable/install .NET 3.5.
Now, my question is when would one actually have to enable/install .NET 3.5 because the app would not work on .NET 4? That is: what should the app do, or what assemblies should it reference, or code to run so that it will not be compatible with .NET 4? Under what circumstances will that be the case? Or is it always compatible and one is fine by just adding the above to the config file?
Best How To :
.NET 4.0 was the first version where Microsoft deemed it safe again to make heavy changes in the CLR and the base class libraries from the .NET 2.0.50727 version. And fix several obscure bugs, the kind that could not be fixed without having an effect on programs that might unintentionally have a dependency on the buggy behavior.
There was precedent for this kind of caution. Infamous within Microsoft was the .NET 2.0 release. After many, many tests that verified it would not break existing .NET 1.1 programs, it was released within the company. And promptly broke a program written by an intern that was involved with email distribution. Which contained a threading race bug, never detected before. Until the improvement in the 2.0 threadpool scheduler changed the timing and triggered the race. Everybody was without email for two days :)
The odds that your program has a similar problem on .NET 4 are very low. But not zero. By adding the entry in the .config file, you acknowledge that you are sure that you don't and have tested your program to verify that it still works correctly. It is in practice a cop-out for Microsoft Support, they don't have an obligation to provide you with a hotfix. They can simply tell you to remove the line from the .config file :)
Gain confidence that you don't have such a problem. Put the "v4.0" first.