It is necessary that when you start the program (necessarily C #), the presence of the installed .NET Framework 3.5 and higher is checked.

So far there are two solutions to the problem: 1. Open the .NET Framework 2.0 program and if it passes the test, then run on the version above. 2. Write in another environment that can check for the presence of the .NET Framework as such and then run the program.

I would like to hear your opinions.

On the first point, I cannot find how to change the platform being launched and how then to switch to another program. For the second, what to write about and, again, how to run a program written in C #.

    2 answers 2

    No, no, do not roll.

    The program should not just be launched, but installed on the client machine. The installation includes the installation of all necessary redistributables, including the correct version of .NET. This means that if your target is a platform under Windows 7 (on which .NET 3.5 is installed automatically ), you need to carry with you either a complete redistributable or a web installer.

    In any case, checking and installing the necessary libraries is not the program's problem, but its installer.

      In addition to the answer @VladD , with which I fully agree, a couple more options come to mind:

      1. Together with the program, supply the .config file with an indication of the required platform (you can read more here ), an example of the contents of the configuration file:

        <?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup> </configuration> 

        In theory, in the absence of the required version of the platform, a window should appear asking you to install the required version of the framework.

      2. Make a small auxiliary application - bootstrapper (compiled under the second framework, if it is on .net, or a simple native application in any language), which, when launched, will check the version of the Framework (best for the registry), and if everything is bad, it will report This, and if all is well, will launch the main application.