Click here to Skip to main content
Click here to Skip to main content

VB 6.0 to VB.NET Migration Command Line Arguments Issue

, 29 Oct 2006
Rate this:
Please Sign up or sign in to vote.
Command line arguments issue when we migrate a VB 6.0 application to VB.NET using the VB.NET upgrade wizard

Introduction

When we migrate a Visual Basic 6.0 application to Visual Basic .NET using Visual Basic .NET upgrade wizard in Visual Studio .NET 2003, we have to take care of certain areas in the migrated application for smoother execution. This article will discuss one of the key areas, called command line arguments, which we need to consider as post-migration changes in the upgraded Visual Basic .NET application.

Visual Basic Command Line Arguments

One of the main features of Visual Basic is the ability to accept command-line parameters when an application is executed. Even with a GUI available to you, there are some cases in which you need to build a VB application that doesn't have a front-end. In these cases, one of the easiest ways to control the function of the application is through command line arguments. Command line arguments are passed into Visual Basic by way of the Command$ variable. This variable is a very long string with all the arguments written exactly as the user entered them. When running an application, you would add them to the shortcut or the Run line.

Visual Basic 6.0 to Visual Basic .NET Migration

Microsoft has provided the Visual Basic .NET upgrade wizard as part of the Visual Studio .NET 2003 IDE. It assists the user with upgrading an existing Visual Basic 6.0 application to a Visual Basic .NET application with minimal effort. The wizard makes all the necessary syntax changes. The Visual Basic 6.0 forms and controls are upgraded into the proper Windows Forms and controls in Visual Basic .NET.

However, there are many features in Visual Basic 6.0 applications that are not upgraded by the wizard. This is primarily due to the very significant differences in the syntax and the architecture between Visual Basic 6.0 and Visual Basic .NET. The upgrade wizard provides a good starting point for the migration because it upgrades the basic features of the Visual Basic 6.0 application. Post-migration changes have to be done in Visual Basic .NET code to make it work in the Microsoft .NET environment, based on the issues identified in the upgrade report.

Command Line Argument Issue

The upgrade wizard will not identify all the issues while upgrading from Visual Basic 6.0 to Visual Basic .NET. One of the key issues is that the upgrade wizard will not identify the command line arguments from the project properties of the existing Visual Basic 6.0 application. If the existing Visual Basic 6.0 application has command line arguments then the upgrade wizard does not take those command line arguments to Visual Basic .NET. We have to copy this command line information manually and put in the Visual Basic .NET debugger. To do this, we have to proceed with the following steps...

Identify the Command Line Argument from the Existing Visual Basic 6.0 Application

  1. Open the Visual Basic 6.0 application's project
  2. Select Properties from the Project menu
  3. Click the Make tab
  4. As shown below, check if there are any arguments in the Command Line Arguments box that the application takes

    VBConfiguration.Jpg
  5. If you have found any arguments listed as similar to the above, then copy these argument values.

Set Command Line Arguments in the Visual Basic .NET Application

Once the upgrade wizard completes the migration from Visual Basic 6.0 to Visual Basic .NET, from the Visual Basic .NET project IDE:

  1. Open the migrated Visual Basic .NET application solution
  2. Select Properties from the Project menu
  3. Click Configuration Properties from the left-hand side pane and click on Debugging
  4. Select Debug from the Configuration dropdown.
  5. As shown below, paste the command line arguments which we have copied in the previous section in the Command Line Arguments box under the Start Options section
VBNETConfiguration.Jpg
  1. Click the Apply button
  2. Now select Release from the Configuration dropdown
  3. Again, paste the command line argument which we have copied in the previous section in the Command Line Arguments box under the Start Options section

Note: Here we are pasting the copied command line arguments for both Debug and Release mode builds.

  1. Click Apply and then click the OK button

Conclusion

Doing these manual changes will help the migration process go smoother and faster. Similarly, the developer has also to take other configuration items which are done in the existing Visual Basic 6.0 application while upgrading to Visual Basic .NET.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

No Biography provided

Comments and Discussions

 
Questioncommand line parameters PinmemberMZektser26-Mar-08 8:29 
GeneralThe images are not loading! PinmemberMojoJosh25-Oct-06 3:38 
GeneralRe: The images are not loading! Pinmembergxdata30-Oct-06 21:51 
GeneralRe: The images are not loading! PinmemberMojoJosh31-Oct-06 2:41 
AnswerRe: The images are not loading! PinmemberSadish Kumar.V31-Oct-06 2:46 
GeneralRe: The images are not loading! Pinmembergxdata31-Oct-06 4:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 30 Oct 2006
Article Copyright 2006 by Sadish Kumar.V
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid