8

I wrote a visual c# 2008 windows form application ,then i edited the code in a computer which had visual studio 2010,but i can no longer run it in visual 2008,is there a way i can do this?

lajoo
  • 150
  • 1
  • 10

2 Answers2

12

When you say "can no longer run it"... what happens?

  • the sln files are not compatible; you'll need different sln files for each VS version
  • the csproj are mostly compatible, although you might see a "version 4 not recognised, using 3.5 instead" warning or two, which is usually fine
  • the cs is compatible as long as you don't use dynamic or the other new language features

In most cases you can get away with just having a separate sln for VS2010. So just rename it to "Whatever_2010.sln", get your old "Whatever.sln" back from your source repository, and rename it to "Whatever_2008.sln".

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • If you want to get rid of the "tools version 4.0 not recognized" warning, you can just look for it in the .csproj files and change the "4.0" to a "3.5" by hand. – Joel in Gö Jan 19 '11 at 14:27
  • after changing Tools Version to 3.5. Visual Studio 2010 asks me to upgrade your project.. After upgrading it replaces this 3.5 with 4.0 – Mohsan Mar 10 '11 at 05:58