Search This Blog

Thursday, May 7, 2009

Converting a Visual Studio 2010 Project to Visual Studio 2008

While testing the Visual Studio 2010 CTP went ahead and created a project, forgetting that the target version was in reality Visual Studio 2008. That said, since it was working just as it was required; found myself with the need to find a way to convert it backwards with as little re-work as possible.

Keep in mind that the Visual Studio 2010 CTP is still not the final release and things might change down the road, but for the moment the steps that worked for me are listed below.

· Open the .sln file corresponding to the Project to be converted with Notepad

· Locate the following line: Microsoft Visual Studio Solution File, Format Version 11.00

· Replace 11.00 with 10.00

· Locate the following line: # Visual Studio 10

· Replace 10 with 2008

· Save the File

· Delete the .cache files existing in the following paths:

o obj/debug

o obj/release

· Open the project with Visual Studio 2008

· Build the project with Visual Studio 2008

59 comments:

  1. Thank you so much dude, i thougt i screwed up my entire project! Thx so much again!

    ReplyDelete
  2. When I try to open the porject file in 2008, I get an error message saying "Unable to read project file of type csproj.

    ReplyDelete
  3. From the provided information I do have a couple of things that come to mind:
    1- Either Visual Studio is not installed or not correctly installed
    2- Visual Studio has not been installed with the C# project capabilities

    Could you provide more details to be able to help you better?

    ReplyDelete
  4. Hey, thanks a lot. u are a life saver :)

    ReplyDelete
  5. Thanks! VS2010 has become completely unusable has it keeps hanging on build and closing the (coded) application. though my .cache files where up one level. in obj/

    <3

    ReplyDelete
  6. Thousands of Thanks :D my Assignments are due tomorrow and did it using VS2010 Premium(RTM) but later figured that its not working in 2008. The above conversion worked perfectly :)

    ReplyDelete
  7. Miles de gracias, has salvado mi vida xd

    ReplyDelete
  8. Thanks so much, man!

    ReplyDelete
  9. Addition: After applying these changes i still had the same error (solution file is created in a newer version etc) when trying to open the project from the "recent projects menu". But by using file - open i could open the solution just fine

    ReplyDelete
  10. Fantastic, thanks!

    ReplyDelete
  11. Thanks, u help me a lot xD

    ReplyDelete
  12. Mate you are great! Good on you ! :)

    ReplyDelete
  13. worked like a charm
    TY

    ReplyDelete
  14. thanxxxxxxxxxx alot
    god bluss you

    ReplyDelete
  15. It did work, of course a little debugging works are required. But finally, I get my job done. It is amazing! Thanks a lot.

    ReplyDelete
  16. Thanks a lot. I have to submit my assignment in 20 minutes but just found out this kind of problem.
    Thanks for the solution

    ReplyDelete
  17. hey, can you help me?
    I've changed the .sln file, but when I try reload my project the following message show up: "*.vbproj cannot be openned because its project type(.vbproj) is not supported by this version of application"
    What should I do?
    thanks

    ReplyDelete
  18. Renier,

    Try opening only the project not the solution. Once the project is open, save the solution and overwrite the sln file.

    Regards,

    Doug Ortiz

    ReplyDelete
  19. Don't forget to check the .NET Framework settings in the *.vbproj file. The callout is something like...

    Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"

    I believe the default framework for 2010 is 4.0 and for 2008, 3.5.

    Jim Mosher

    ReplyDelete
  20. Damn! this is awesome! thanks a lot!

    ReplyDelete
  21. Awesome, now @ home where i have 2010, I can work on work projects where I only have 2008 and still open them in 2008. I created 2 sln files so I just open the correct one.

    Thanks!!

    ReplyDelete
  22. Seriously dude...This is a great help!!! keep it up..thanks

    ReplyDelete
  23. it works! thanks a lot

    ReplyDelete
  24. thanks man seriously, it helped a lot,,,,,, but help me there's a problem it's asking for system.drawing version=4.0.0.0 and saying it can't find the specified field
    what should i do now ?

    ReplyDelete
  25. Anonymous,

    Remove all references to the .Net 4.0 Framework in the project, that should take care of your problem.

    Regards,

    Doug Ortiz

    ReplyDelete
  26. cheers mate , it helps alot

    ReplyDelete
  27. You totally saved my rear dude! Thanks!

    ReplyDelete
  28. thanx man !
    if any one having problem of framework then go to "csproj" and replace framework 4.0 with 3.5
    and have fun

    ReplyDelete
  29. thanks dude. It worked

    ReplyDelete
  30. thanks a lot dude....u saved my project...:)

    ReplyDelete
  31. Dude!!Thanks Man.You are a life saver!

    ReplyDelete
  32. Thanks!
    Also... I had an error in my config file.

    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral >

    Changed:Version=2.0.0.0

    ReplyDelete
  33. You are awesome. I reverse your solution, And then open VS2008 file in my new VS2010. THIS REALLY WORKS. YOU just save my coming assignment.

    ReplyDelete
  34. Good finding, thanks a bunch. Astonishing that VS2008 can't try this simple trick automatically when attempting to open a solution with an incompatible version...

    ReplyDelete
  35. Cheers mate, saved me a massive headache

    ReplyDelete
  36. i'm facing prbl while running a project vs 2008 developed in 2010.showing error "cannot load file system.web .... 4.0.0.0" something like this...can anybody help me,wht to do?

    ReplyDelete
  37. bipin,

    From the description of the error message it sounds like you should check the target framework of the project solution.

    Regards,

    Doug Ortiz

    ReplyDelete
  38. Thanks but will it work for Visual Basic 2008

    ReplyDelete
  39. cara vc me salvou velho , muito obrigado mesmo ,parabens pelo post

    ATT

    Hugo Gomes

    ReplyDelete
  40. Esse linha de código deve se alterada em que arquivo:
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0,> Culture=neutral
    Alterado: Version = 2.0.0.0

    ReplyDelete
  41. What do I do with the coding above? I need to open a vb 2010 file in vb 2008

    ReplyDelete
  42. Anonymous,

    The coding above is for the sln file.

    ReplyDelete
  43. you saved me big time. I owe you a beer.. :)
    Sandeepta

    ReplyDelete
  44. Thanks so much! Worked flawlessly.

    ReplyDelete
  45. Doug, i did everything as you mentioned..but still i am getting some error message..

    Could not load file or assembly 'MyProject'(it's my project name) or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

    ReplyDelete
  46. Nick,

    The error you are getting is because one of the dependencies, particularly an assembly was built in a newer version of Visual Studio. The project has been converted successfully but these dependencies are not being loaded and causing the project loading to fail.

    Doug

    ReplyDelete
  47. I would recommend performing the conversion process to 2008 to these dependencies , that will resolve your issue.

    ReplyDelete
  48. THANKS A LOT THIS INFORMATION REALLY SAVE MY TIME
    THANKS A LOT ONCE AGAIN

    ReplyDelete
  49. Hey I got the below error: Can any one help me with this??
    Unable to read the project file:
    The tools version "4.0" is unrecognized

    ReplyDelete
  50. Satya,

    Check carefully step #2, it seems you did not update it with the correct number.

    Regards,

    Doug Ortiz

    ReplyDelete
  51. Help me please.. i already followed your steps but i don't know what's going on..

    here's the error msg..

    wpfApp.csproj cannot be opened because its project type. (.csproj) is not supported by this version of visual studio

    ReplyDelete
  52. By the error that you have listed, it seems you are using either Web Matrix or a version of Visual Studio that does not support csproj. Check to see if your version of Visual Studio is correctly installed.

    Regards,

    Doug Ortiz

    ReplyDelete
  53. Works perfect, thanks!

    ReplyDelete