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.
C#.NET Programming

Avatar of undefined
Last Comment
Idarac

8/22/2022 - Mon
AndyAinscow

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
Idarac

ASKER
So if I setup for .Net version 4.0 will it still work with 4.5?
unknown_routine

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
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
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Idarac

ASKER
Thank you