Link to home
Start Free TrialLog in
Avatar of Idarac
Idarac

asked on

Setting up a C# .Net program

I am starting my first C# .Net program.

How do I setup the settings so that the program will run in .Net 4.0 frameworks and beyond 4.5 etc.
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

When you create a new project at the top of the form is a combo box - in that is the target framework (eg. .Net Framework 4).

If you have an existing project then in the solution view right click the project and choose properties from the menu.  In the tab view select Application and there is target framework in a combobox eg. .Net Framework 4
Avatar of Idarac
Idarac

ASKER

So if I setup for .Net version 4.0 will it still work with 4.5?
Yes. It does work "if" you do not use 4.5 Functions and features in your code.

An example is SortVersion class which belongs to 4.5 only.

If you set up for .Net 4.0 and use SortVersion class in your code you get compile error.
Avatar of Idarac

ASKER

So if I set 4.0 I can only stuff related to 4.0 and can I assume backward compatible correct?
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Idarac

ASKER

Thank you