Accessing the Upgrade Tool from the Command Line

The automated upgrade tool can also be applied from the command-line using the VBUpgrade.exe upgrade program. This program uses the same upgrade engine as the upgrade wizard accessed in Visual Studio .NET. Assuming the default installation directory is used, this program can be found in the following path:

drive:\Program Files\Microsoft Visual Studio .NET version\Vb7\VBUpgrade\

In this path, drive indicates the drive letter on which the installation resides and version indicates the Visual Studio .NET version. For example, this guide was written for the Visual Studio .NET 2003 IDE, so the full path would be the following:

drive:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBUpgrade\

If you installed the upgrade tool to a location other than the default directory, or if you are otherwise unsure about where the program is located, you can use Windows Explorer to locate it. The remaining text for this example assumes you have the directory of this utility in your command search path.

The command-line upgrade tool produces the same results as the upgrade wizard. To upgrade a project, the project file name and the destination directory need to be indicated as arguments to the command. If the destination directory does not exist, the upgrade tool automatically creates it. For example, the following statement upgrades our sample project, stored in C:\SumApp\SumApp.vbp to the C:\SumApp\SumApp.NET directory.

vbupgrade c:\SumApp\SumApp.vbp /Out c:\SumApp\SumApp.NET

Note that you should replace the directory names with the appropriate locations.

The command-line version of the upgrade tool does not have wizard pages. Furthermore, this tool does not delete any files in the destination directory. If the destination directory already exists and contains files, the command-line tool stops running and returns an error.

It is recommended to use the command-line tool when the available memory on the upgrade system is limited. Using this tool saves the system resources needed by Visual Studio .NET when the upgrade tool runs. Depending on the system configuration, Visual Studio .NET consumes approximately 15 MB of memory.

0 0

Post a comment