Click here to Skip to main content
15,559,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

While running a C# 2.0 application in VS 2010 it display an error message.

Is it possible to convert C#2.0 application to C#4.0?
Updated 7-Jul-11 22:10pm
Prerak Patel 8-Jul-11 3:01am    
Did you even try?
Uday P.Singh 8-Jul-11 3:08am    
post the error message!!
[no name] 8-Jul-11 3:10am    
What Error it displays.
Groulien 8-Jul-11 3:19am    
Did you create this project in an older version of Visual Studio? If so, it's not trying to target C#4.0 and you're asking the wrong question.

When you open a solution or a project created with older versions of Visual Studio with version 2010, you will be offered to run through solution/project converter which will only modify solution and project files, automatically.

As a result of a build you may get some warning due to obsolete types/members.

As Visual Studio prior to 2008 was not multi-target, you may need to change the target Framework to v.4.0. You can select any the target Framework version, they are backward-compatible. The solution targeted for 2.0 will be readily run in the Framework 4.0 or 3.5.

Share this answer
[no name] 8-Jul-11 4:37am    
Sergey Alexandrovich Kryukov 8-Jul-11 4:39am    
Thank you, Ramalinga.
[no name] 8-Jul-11 8:41am    
It's my Pleasure.
Tarun.K.S 8-Jul-11 4:57am    
Correct. 5+
Sergey Alexandrovich Kryukov 8-Jul-11 4:58am    
Thank you, Tarun.
Just change the Target Framework from 2.0 to 4.0 in the Project Properties.
Share this answer
Sergey Alexandrovich Kryukov 8-Jul-11 3:46am    
Correct, bit not 100% clear because you should have explained what happens to projects and solutions and compatibility. I voted 4 and provided additional explanations; please see my solution.
JV9999 8-Jul-11 3:48am    
I do wonder why you deleted my answer which was given earlier but stated exactly the same....
Christian Graus 8-Jul-11 3:54am    
There is no way of knowing who deleted your answer. Ramalinga is not an admin AFAIK.
JV9999 8-Jul-11 4:04am    
According to the FAQ somebody with platinum authority should be able to delete (which he is). But let's get on topic... I shouldn't have asked it anyway...
Tarun.K.S 8-Jul-11 4:56am    
Right. 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900