For example, the program has 2 blocks of code:
- one for the old .Net Framework,
- and the other for the new .Net Framework (in other words, its chips are not compatible with the old version).

Tell me, is it possible, depending on the installed .Net Framework, on the client’s machine to choose which .Net Framework to use in the program, and to switch blocks of code?

  • "what .Net Framework to use" - in app.config you can specify - Stack
  • "there are 2 blocks of code: One for the old .Net Framework, and the other for the new" - the new has backward compatibility with the old. - Stack
  • I know about backward compatibility. The question is different, if I write an application for the old .Net Framework, I cannot use all the new .Net Framework features, although they may be more productive than the invention of a bicycle on the old version, and if I initially write for a new one, then people with the old .Net Framework will not be able to work with the program. - iluxa1810
  • "if I initially write for a new one, then people with an old one" - yes, but it’s not difficult to put a new one. or is it impossible for some reason? - Stack
  • one
    "there are 2 blocks of code: One for the old .Net Framework, and the other for the new" you can in the installer offer the user a choice of which components to install based on the capabilities of his system, but this is if the assembly is large, for a single-file one it is overkill. - rdorn

1 answer 1

If you have a large build and you already have separate modules for different versions of .NET, then you can in the installer of the program offer the user a choice of which modules to install, based on the capabilities of his system.

If the assembly is single-file, then it is easier to build several versions of the program for different versions of .NET.