By Arif Khan
With Microsoft announcing the phasing out of VB6, VB developers will need to adapt to the changes the VB.NET environment brings in. It takes significant effort for porting applications in VB to VB.NET. In .NET environment, backward compatibility to VB is not a high priority goal for Microsoft.
.NET Framework 4.6
The latest .NET Framework version 4.6 is shipped with Visual Studio 2015, which offers a host of new features for building applications (apps). Runtime changes sometimes affect existing apps with every version release in .NET Framework. If your app runs on a previous version of .NET framework but its runtime is of a later version, differences may be in the behavior between apps.
Currently, .NET is automatically installed in Windows 10 systems and comes with several new fixes and features including enhanced cryptography, enhanced Windows (Communication, Presentation, Workflow) Foundation services, converting windows forms and platform apps to Universal Windows Platform (UWP), updated ClickOnce to support Transport Layer Security (TLS) & automatically detect required protocols, and debugging improvements.
Migrating to .NET environment should be handled carefully as the major change from VB to VB.NET is that VB.NET is based on Common Language Runtime (CLR). For the .NET applications developed in VB, C++, C# or other languages, the CLR serve as an execution platform. VB as a programming language has undergone significant changes in the CLR new programming model. To take best advantage of the .NET platform features and structures, it is better to rewrite the application than porting. Many a times rewriting isn’t feasible and you end up converting VB6 code to VB.NET using Upgrade Wizard.
When you start converting VB6 to VB.NET, certain steps should be taken. Begin with a plan, identify processes, gather requirements, and eventually build the architecture of the solution. To upgrade your application to .NET framework 4.6, first one need to open the project in Visual Studio 2015 and check for compatibility. In order to take advantage of new functionalities in .NET framework 4.6, run the application on latest point releases without recompiling it.
Migration from VB6 to VB.NET should be done in a systematic way comprising of analysis and design phases upfront. This helps in an easier implementation to the .NET environment and saves time and cost associated with software development. Once your VB6 to VB.NET plan starts taking shape, then start with VB6 to VB.NET development.
Converting the Application
The VB6 to VB.NET analysis part is slightly different in this case. Begin by studying the current application, and try to identify code blocks that require changes. VB6 app migration to .NET should be carried out by converting the existing application to .NET and then fixing the converted code in .NET. For this you can use the Upgrade Wizard that converts the project into VB.NET without affecting the existing codes. Codes in the original VB6 project are compared with that of the converted VB.NET syntax for consistency and subjected to various rounds of debugging to clean up the codes.
A list the VB6 to VB.NET migration steps include the following:
• Determine scope and perform requirement analysis.
• Create a migration strategy and come up with migration effort.
• Convert application logic to .NET framework.
• Convert session and application variables.
• Convert HTML form menus, UI items and perform unit testing.
• Perform System testing.
• Import legacy data and perform load testing.
• Deploy to application server.
During migration, if the existing VB6 code has good interoperability between component object module components and .NET framework, then place the existing code that can call your library. This helps in saving time and focusing more on writing new code for the application.
Oddly, as much as everyone ridicules VB6 as a “toy” language, I’m seeing more and more VB6 jobs becoming available. The VB6-Developer (full-time) is starting to become a rare breed. As more transition to .NET, no one wants to go back to the “Dark Ages” before enlightenment and its being reflected in opportunities and salaries. It’s not all that different to what happened with COBOL, which is still out there alive and kicking.
Success Migrating VB6 to VB.NET
If done right, VB6 to VB.NET is an easy process, so if you or someone you know wants to learn more about VB6 to VB.NET feel free to contact Macrosoft Inc. SW
Arif Khan is the project Manager at Macrosoft Inc. Khan has more than 19 years of software development and management experience that includes analysis, designing, documentation and implementation of object oriented customized solutions for the various industries ranging from financial, telecommunications, and health care, and other various consumer markets.
Feb2017, Software Magazine