Solved

Setting up a C# .Net program

Posted on 2013-11-25
6
339 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 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