Converting a Visual Basic 6 business application to the .NET Framework platform is a slow, costly, and error-prone job that requires a deep knowledge in all the subtleties of both VB6 and .NET languages.
In past years, developers tried to migrated their VB6 apps to VB.NET using the Upgrade Wizard (UW), a very basic conversion utility that Microsoft included in older releases of Visual Studio .NET. Not surprisingly, given the complexity of the task and the many pitfalls of that software, their attempt was nearly always a failure. After a few years, Microsoft retired the UW and nobody ever missed it.
More powerful VB6 migration tools later appeared on the market, yet they share with UW the same basic approach to code conversion – or even the same engine – and, for this very reason, they fail to significantly simplify the migration process to the point where it becomes truly cost-effective. Not surprisingly, many software companies have abandoned the idea of migrating their code to .NET or decided to do it without an automatic translation tool.
In 2008 Code Architects launched VB Migration Partner and changed the rule of the game.
VB Migration Partner supports all the main VB6 features and controls, and delivers VB.NET or C# applications with significantly fewer compilation and runtime errors than those produced by other conversion tools. While our competitor can only “prove” their effectiveness only on VB6 samples they wrote themselves, our tests on hundreds of randomly chosen open source applications show that our software correctly converts 99.9% of most VB6 apps you can throw at it.
So you can easily understand why VB Migration Partner gained enthusiastic feedback from users in all five continents, converted thousands of VB6 projects for over 100 million lines of code, and counting.
Reports, reports, and reports
At the end of the migration process, VB Migration Partner produces a very detailed list of migration messages, which you can sort, filter by severity, or just double-click to see the VB.NET or C# statement that produced a specific warning.
VB Migration Partner produces 400+ different types of error or informative messages, therefore the bulk of information can be overwhelming at first. For this reason, we offer the ability to suppress messages of any given type. This feature is based on – you guessed it! – pragmas and you can decide which and where messages should be shown or disabled; likewise all pragmas, you can have different settings for each project, file, class, form, and method.
Once you have a list of migration warnings you can leverage one of the VB Migration Partner’s most useful features. Just run the Explain Errors and Warnings command to get a detailed explanation of each message, read how to fix the problem, study VB.NET and C# code examples, click on link to the relevant portion of our online documentation, and more. It is like having a person from our tech support sitting beside you.
In addition to warning messages, VB Migration Partner produces accurate reports with sophisticated code metrics on the code being migrated, such as total and average cyclomatic index, maximum and average depth of control structures, and ratio of comments to code. These reports can be exported to Microsoft Excel to provide a realistic estimation of time and cost of the entire migration process.
A new breed of conversion software
VB Migration Partner relies on a sophisticated conversion engine that can handle constructs with no direct equivalent in the .NET Framework world. The code generation module and the powerful refactoring module emit VB.NET or C# code that rivals in quality with code written by skilled developers. In spite of all this extra power, VB Migration Partner is up to 8x faster than Upgrade Wizard. When converting projects with hundred thousand or million lines of code, you will appreciate this extra speed.
Most conversion tools on the market offer very few options to customize the migration process. Worse, you can apply these options to either enable for all forms and classes in the VB6 project, or to none of them. This all-or-none approach is a primary cause of frustration for developers attempting to migrate from VB6.
Conversely, you can customize and fine-tune VB Migration Partner to deliver exactly the code you want. You achieve this flexibility by applying migration pragmas, i.e. special remarks that you insert in the original VB6 application and that guide the migration engine during the conversion process. For example, the ArrayBounds pragma affects how arrays are translated; the AutoNew pragma dictates how auto-instancing (As New) variables are rendered; the SetType and ChangeType pragmas allow you to change the type of a variable, and so on.
Much like variables or methods in a traditional programming language, migration pragmas have a hierarchical and granular scope: you can apply a given pragma at the project-level (to enforce a conversion rule for the entire application) but also at the file-, method- or even variable-level (for exceptions to the general rule). VB Migration Partner supports over 80 different pragmas to solve all the challenges that you face during a complex migration project. VB Migration Partner’s IDE can guide you through the insertion of a new pragma, using an easy-to-use dialog box that explains the meaning of each pragma and its arguments.
Large migrations, you don’t scare us
The main problem with real-world business applications is you cannot freeze VB6 development until you complete the migration and the test of the .NET application, because with large applications such a process might take weeks or months. In fact, if you use a conversion tool from our competitors either you stop extending the original VB6 application –or- you manually apply extensions to the .NET code after the migration is completed.
VB Migration Partner can offer a much better alternative, based on our convert-test-fix methodology. Briefly, it goes like this: you run and test VB.NET or C# code to fix compilation errors or reach functional equivalence; then you go back to the VB6 source and add the pragma that solves the problem for you; and finally run VB Migration Partner again. Developers working at the migration and those extending the VB6 project can share the same codebase and the VB6 and .NET applications are always in-sync until the migration task is over. Problem solved!
Another tricky problem you face when migrating a large VB6 project is the huge number of compilation errors you get when you first run it through any conversion tool. Often there are so many errors that they exceed the Visual Studio’s ability to show all of them, thus you don’t really know how long it takes to fix all of them. If you are out of lack, it can take many days just to reach the zero-compilation-error stage, which is a prerequisite for running the converted code inside Visual Studio .NET.
VB Migration Partner is the only VB6 conversion software that allows you to migrate only individual forms, modules and classes, so you can effectively convert in your VB6 application one piece at a time. This is how it works: the ExcludeMethodBody pragmas tells VB Migration Partner to convert only the signature of program symbols (e.g. class, method and variable names) but omit the generation of code inside methods for the files you do not plan to migrate immediately. This approach dramatically reduces compilation errors to a manageable number. For example, you can migrate just the main form and the few modules that are necessary during the startup process, then fix the (few) compilation errors these files produce and run the .NET project. When the VB.NET or C# code works fine, you include more forms and modules and repeat the process. In any given moment, you know where you are in the migration process, can predict how long it takes, can plan set realistic goals for your team, and so forth.
VB Migration Partner offers the best support to so-called staged migrations, i.e. large migration projects of multi-tiered and COM+ applications where you convert one tier at a time. For example, you might decide to start migrating the data or business DLLs and keep the VB6 user interface tier without recompiling it or, conversely, start working on the new .NET user interface and postpone the conversion of VB6 components. This approach is made possible by the support for backward binary compatibility, which no other VB6 migration software offers. (Note: this feature is only available when converting to VB.NET.)
VB Migration Partner also supports batch migrations, a crucial feature to convert hundred or thousand VB6 projects. Even with a fast computer, this process that can take hours with our conversion engine (or days with the tools from our competitors!). Using batch migrations, VB6 projects are converted in the right order and compiled with the VB.NET or C# compiler, then VB Migration Partner produces a consolidated report of all warnings and errors. You have the option to stop the batch migration if any error occurs, or complete it no matter what.
At the end of the migration project it is essential that you can prove that the final .NET code works exactly like the original VB6 application, but such evidence isn’t always easy to achieve. For this reason, we provide the Trace Match tool, that traces the execution flow in both the VB6 and the .NET code, so that you can compare the result and see whether and where the two languages behave differently.
Last but not the least, VB Migration Partner can be fully customized by means of an extension object model that gives you full control on code generation. For example, you decide how a given control must be translated or how code must be post-processed to fit your coding standards. You can write your custom extensions using VB.NET or C#, no need to learn a proprietary language or any weird syntax.
With all these unique features, in over one dozen years since its launch, VB Migration Partner has tackled countless huge, enterprise-level applications of any size, up to solutions with 1500+ individual projects and 6.5 million lines of executable code (i.e. remarks excluded!).
A closer look
VB Migration Partner owes its superior performance to three factors.
First, a state-of-the-art parser is able to interpret all VB6 constructs, including those that were previously considered as hard or impossible to convert automatically, such as “As New” with true lazy-instantiation semantics or object default members in both early- and late-bound modes.
Second, an advanced code generation engine delivers high-quality VB.NET code using code-analysis and refactoring techniques. You can fine-tune the behaviour of code generation by means of pragma, to transform Gosub keywords into calls to separate methods, convert On Error statements into Try-Catch blocks, infer the correct type of Variant and Object variables, and a lot more.
VB Migration Partner emits code of the same quality of an expert .NET developer, so you don’t need to be one. For example, it converts ByRef parameters into by-value parameters if possible, or output-only parameters (C# only); it merges nested IF blocks into a single IF statement, using the AndAlso (VB.NET) or && (C#) keyword. It can enforce deterministic finalization of IDisposable objects, generate method overloads to account for optional parameters (especially useful for C# conversions), recognize and optionally remove methods and variables that are never used, etc.
The unique power of VB Migration Partner becomes apparent with its support library, which dramatically reduces the differences between VB6 and .NET and ensures that converted applications run as the original VB6 code did. In a nutshell, we have recreated the original VB6 library using only .NET features and modern object-oriented programming techniques. We support over sixty VB6 controls with all their properties, methods and events; graphic commands such as Line and Circle; the DataEnvironment object and databinding with DAO, RDO or ADO sources; drag-and-drop methods and events; objects such as App, Screen, and Clipboard and virtually anything else that was included in VB6.
A support library provides countless advantages over traditional techniques based solely on code mapping: in fact, VB Migration Partner generates code that is more readable, concise and efficient than any other migration tools on the market. Read more here.
Where to go from here
If VB Migration Partner sounds as the right tool for your migration needs, have a look at the following sections on this web site for more detailed information:
- the From VB6 to .NET in 10 Easy Steps whitepaper explains how to successfully perform your first migration
- our FAQ page, containing answers to many recurring questions we received from customers over the years
- the online manual, with detailed descriptions of all features, a reference guide to pragmas, etc.
- the code samples section, that demonstrates how we have used VB Migration Partner to migrate many open source VB6 applications and book samples
- the knowledge base, a collection of short articles that show how you can solve common issues that arise during the migration process
For further questions, just email us