Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone. I have such a problem. My program, written in C#, is targeting .Net Framework version 2.0 . And now I am having problems with Windows 8 OS. I searched through Google and found, that in Windows Features ( in Control Panel) there is a checkbox - .Net Framework 3.5 (includes .Net 2.0 and 3.0), when checking that check-box, the problem is solved. Now , what C# Code do I have to use in my program, for auto checking that box, when my program is opened.

Thanks for help.

Romo
Posted
Updated 22-Dec-14 3:08am
v2

You don't. Do not modify a user's system. You simply state in the documentation what the requirments are and it's up to the user to ensure that the system provides those requirements.
 
Share this answer
 
If your .NET application is compiled against a certain version of the FrameWork, and that version is not present/available in the machine your application is run on, you will, obviously, not be able to run your application.

This is why many install processes provide some way to alert the user to the requirement for a certain version of the FrameWork (or the FrameWork itself, if not present). For example, see: [^].

The other alternatives are:

1. if no version of the FrameWork is present, then you'd have to write a non-.NET program that would advise the user to download and install the FrameWork, and then launch your Application.

Since WinXP, Windows has shipped with a version of the FrameWork installed, although the user might have removed (from the Control Panel).

2. if some version of the FrameWork is present, then you could provide the user a "launcher" application compiled against the version you know is present, that would start-up, test to see if the required version of the FrameWork is present, and, if not present, advise the user to install, etc.

You can find an example of a program that does not require the FrameWork is installed and that tests is .NET is present in an article here on CodeProject: [^].

And, check out using MS' ClickOnce install process; it will do the right thing to get the version of the FrameWork needed installed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900