VB 6.0 to VB.NET Migration Command Line Arguments Issue

View: 3303    Dowload: 0   Comment: 0   Post by: naruto   Category: Visual Basic   Fields: Computers - Technology

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

  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

  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.

VB 6.0 to VB.NET Migration Command Line Arguments Issue

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.

Posted on 21-03-2014 

Comment:

To comment you must be logged in members.

Files with category

 
File suggestion for you
File top downloads
Codetitle - library source code to share, download the file to the community
Copyright © 2018. All rights reserved. codetitle Develope by Vinagon .Ltd