Solved

Setting up a C# .Net program

Posted on 2013-11-25
6
342 Views
Last Modified: 2013-11-25
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.
0
Comment
Question by:Idarac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39674900
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
0
 
LVL 1

Author Comment

by:Idarac
ID: 39674939
So if I setup for .Net version 4.0 will it still work with 4.5?
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 39674952
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Idarac
ID: 39674973
So if I set 4.0 I can only stuff related to 4.0 and can I assume backward compatible correct?
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39674981
There is backwards  compatability, so setting it to version 4 will run on 4.5 and later versions.  If you do not actually use anything specific to version 4 you could even set the version to a lower value eg. 3.
What you can not do is set the version for 4 and code something that requires version 4.5 - the compiler will not accept that.
0
 
LVL 1

Author Closing Comment

by:Idarac
ID: 39675160
Thank you
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question