Convert between VS2008 and 2010 projects, automatically
Recently, I was told that I was being a bother and that I shouldn't develop in VS2010. Sure, the current RC is not the final version, but it's a release candidate, not much will change between now and the RTM (unless something really bad happens). But sometimes you need to conform and give people what they want. Back to VS2008 I went.
I love working with the latest and greatest though, so in a few spare hours just now I have been plotting and scheming and came up with a brilliant solution to thwart the command of my opresser, muhahaha!
Yes, I did it, I created a tool that can convert my complete VS2010 project back to a VS2008 project so that I can commit my code without my opponent knowing worked in VS2010.
This is done, very simply by replacing a few strings in the .sln and .csproj files. Now, this is a simple approach and it will throw away some information that is new to VS2010. However, it works for my purposes and I'm sharing it here so that people will be able to build upon it if they wish, or use it as is.
Mind you, there is NO GUARANTEES and I'm sure this is going to kill your project if you're not careful!
Was that proper warning? Okay, well here it is: two old-school batch files and a tool to do the string replacements (which I got from programmersheaven).
You can now download the fully automated VS2008 to VS2010 converter, enjoy.
Oh HAI Gerben, didn't know you were going to read this...
19 comments on this article
Raphael | April 21 2010 08:33
Works like a charm! Thanks a lot for saving me some tedious string replacing.
MichaelMC | August 4 2010 09:40
Thanks, but it doesn't work for me. The string replacements seem to have been done in the .csproj and .sln files, but my VS2008 (SP1) still barfs when I try to open either.
Fetch | September 14 2010 20:22
Nice job. Definitely works like a charm. I didn't trust it so read throught the bat files and downloaded the source code from programmer's heaven. (I work in a pretty secure network) Anyhow ~ it works right out of the box and converts from 2008 to 2010 and back no problem.
Many thanks!
Stephanie | September 20 2010 02:11
I couldn't find any instructions. How is it used; just open the .sln in VB and then run the .bat file? (Please pardon my newness to all that is VB.)
I'm using Visual Basic 2010 Express.
Sebastiaan Janssen | September 20 2010 08:21
Stephanie: You just drop the .bat file into the same folder as the .sln file is and run it.
Although, you wouldn't need it to upgrade a 2008 project to a 2010 project, VB Express should do that automatically for you.
glen | April 28 2010 08:50
It created all sorts of problems when trying to reload the VS2010 version - may have something to do with third part controls.
bob | November 28 2010 14:29
It worked for me, thanks a lot!
Horst Wutscher | November 28 2010 20:08
Hello Sebastiaan,
i found your migration package here.
Can you explain how it works?
For your information:
I have update my TFS 2008 over backup and restore the databases to a new Server - TFS 2010 and run the migration command.
Now i must update my default CMMI and Agile 4.2 Team Projects from TFS 2008 Server to the new Process Templates 5.0.
Can your script do this? How it works and what did i have to do after run the script?
Thanks for yur help,
Horst Wutscher
J Bo | December 14 2010 01:29
I have tried the 2010 to 2008 .bat and ssr.exe files in both of the directories that my projet has .sln files and still am unable to open in 2008 :(
Sebastiaan Janssen | December 14 2010 07:15
Horst: no, this is not a migration tool, just a simple way to upgrade and downgrade solution and project files.
J Bo: Well, that was..informative. Care to share what exactly went wrong, what did you try to fix it, etcetera?
Craig | December 21 2010 15:59
I had the same thing as J Bo. I ran the .bat file in the directory that I had the solution file. I still get the error, "The selected file is a solution file, but was created by a newer verion of this application and cannot be opened."
To downgrade the solution file, all I did was double clicked on the .bat file and it seemed to run. Do I need to do something else?
thanks!
Michael | December 29 2010 16:42
The batch file works only if you don't have spaces in your paths. For example
c:\Proj\xx.sln works fine but
c:\Doc and Settings\Proj\xx.sln does not
Simple fix is to modify batch files and put quotes around %%a.
Here is new line
for /f "tokens=*" %%a IN ('dir /b /s *.sln') do ssr.exe 0 "Format Version 11.00" "Format Version 10.00" "%%a"
gseagull | May 23 2011 13:18
It worked for me, thanks a lot!
Ramkumar S | May 27 2011 07:55
Its working Great. Wonderful.
Thanks for this.
aaaaaa | April 23 2012 06:41
asdfsdsssssssssssssssssssssss
sanyam | May 4 2012 06:10
can you please send me the instructions that how can i convert my project developed in 2010 to 2008 using your software.
thanks.....
Manit | June 12 2012 07:42
I want Convert VB.net 2010 to 2008. What you have Program for convert?
Thank you
Pratap Kumar | September 28 2012 12:45
Can you please explain how do I convert 2010 to 2008 OR 2008 to 2012.
I need steps to do this.
Thanks
Shankar | October 9 2012 07:22
for /f "tokens=*" %%a IN ('dir /b /s *.sln') do "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /upgrade %%a
instead of using SSE executable ..directly we can use devenv executable with upgrade option to upgrade your projects from VS2008 to VS 2010.