Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bulk upgrade VS2005 solutions to VS2008

Is it possible to bulk upgrade (many at the same time) VS 2005 projects to VS 2008.

I know that I can open one at a time, however, I would like to select say 10 at a time to upgrade and add to a new solution.

like image 722
user62572 Avatar asked Feb 10 '09 22:02

user62572


People also ask

How do I update Visual Studio solutions?

To upgrade a project created in an earlier version of Visual Studio, just open the project in the latest version of Visual Studio. Visual Studio offers to upgrade the project to the current schema. If you choose No, the project doesn't get upgraded.

How do I open an old project in Visual Studio 2022?

Open Visual Studio. On the start window, select Open a project or solution. Visual Studio opens an instance of File Explorer, where you can browse to your solution or project, and then select it to open it.

What is difference between solution and project in Visual Studio?

A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.

Is Visual Studio backwards compatible?

You can work with them as you always have, provided that you don't depend on newer features. We try to preserve backwards compatibility with previous versions, such as Visual Studio 2019, Visual Studio 2017, Visual Studio 2015, Visual Studio 2013, and Visual Studio 2012.


2 Answers

I recently came across the same problem and used a Windows Powershell script to get Visual Studio to do the upgrading for me using the /upgrade command line switch

$slnFiles = ls C:\source -Filter *.sln -Recurse 
$devenv = "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
$i = 1
foreach ($sln in $slnFiles)
{
    "Upgrading Solution " + $i++ + ": " + $sln.FullName
    &$devenv /upgrade $sln.FullName
}
"Done!"
like image 176
Casey Avatar answered Sep 30 '22 01:09

Casey


Slightly modified version of Casey's which is a for VS 2010 and waits for the conversion to complete. This also copies the solution file to one with an x before the .sln.

$slnFiles = ls "C:\projects\source\" -Filter *.sln -Recurse 
$devenv = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
$i = 1
foreach ($sln in $slnFiles)
{
    "Upgrading Solution " + $i++ + ": " + $sln.FullName
    Start-Process -Wait $devenv -ArgumentList /NoSplash,/upgrade,$sln.FullName
    $name = $sln.name -replace ".sln", "x.sln" 
    Rename-Item $sln.FullName  -NewName $name
}
"Done!"
like image 31
Damian Dixon Avatar answered Sep 30 '22 00:09

Damian Dixon