?
Solved

Setting up a C# .Net program

Posted on 2013-11-25
6
Medium Priority
?
358 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

719 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