How to convert VB to C#: a comprehensive case study
Why migrate from VB6 to C#?
With Microsoft having discontinued Visual Basic, many organizations consider transferring legacy software. Modern technologies and approaches, for example converting VB to C#, allow companies remain competitive and adaptable to the ever-changing market.
Working on one of our projects, we assisted a corporation in modernizing their outdated legacy software. Having rewritten some slow AutoCAD functions and implemented modern approaches – converting VB to C# – we helped our client significantly minimize license costs for 75% of end-users and provided for streamlined business growth.
Keep reading to learn about approaching VB6 to C# migration.
The reason you should convert VB6 to C#
Visual Basic is a suiting language to build simple applications, but it’s not the cool kid down the block anymore. If you’re currently using system-specific applications running on Visual Basic, and your software developer suddenly quits, you will be stressed to find suitable candidates.
“Going forward, we do not plan to evolve Visual Basic as a programming language,”
– states Microsoft.
When Microsoft publicly announced its new business strategy for VB, they officially stated that it is used by “thousands” of software professionals compared to “millions” that use C# and other popular technologies. Their intention was to lead C# for cloud, website and mobile development, while VB would be utilized by software specialists for Windows desktop development.
The reasons you should convert VB to C# are clear-cut:
- Visual Basic 6.0 is a proprietary programming language, which means VB-based software cannot easily be transferred to other operating systems
- Visual Basic 6 gives way to programming languages like C#, which provides better declaration of arrays – with C#, you can easily initialize an array of structures at a declaration time
Core goals and challenges
In 2019, Abto Software has started the cooperation with a leading manufacturer in the machinery industry. With over 17 years in the information and technology market and expertise in providing legacy modernization, we migrated several applications, all written in different programming languages.
The project’s main goal was building a custom, state-of-the-art toolkit to design different types of products.
The project’s main challenges concerned the following matters:
- The installed AutoCAD plugin initially written in VBA and LISP caused problems during installation
- Each new AutoCAD version brought issues to the installed plugin
- Some parts of the Microsoft Visual Studio 6.0 legacy functionality stopped working
- Although the AutoCAD plugin still supported Microsoft VB, it was not available by default and required separate download and installation
Delivered value
With the required knowledge and experience, our team has finished the project within deadlines and budget. We migrated the applications to eliminate the limitations coming with VB6 IDE Windows 11, 10, 8/8.1, and 7.
Having provided professional VB6 migration services, in particular:
Having performed successful VB6 code migration, we achieved:
Our contribution
Thorough analysis and roadmapping
After conducting thorough investigation of the AutoCAD functionality, we detected the parts causing hazard and created a Visual Basic .NET migration roadmap comprising the following processes:
1. Convert VB to C#
Our team could successfully:
- Migrate the Visual Basic app efficiently to .NET in C#
- Remove dependencies on the AutoCAD plugin
WPF UI was implemented by utilizing MVVM Light.
2. Extend functionality
We provided additional functionality to cover the needs of users approaching more sophisticated tasks.
3. Build modules for both advanced and beginner users
We created:
- Special modes for advanced users to execute additional commands
- Simple wizards for inexperienced users to cover common workflows
4. Separate the common code
We successfully separated the common code to ensure:
- Correct behavior
- Reliable synchronization
5. Provide convenient reading, saving, and exporting
The solution was integrated with the third-party library WoutWare CadLib to allow:
- *.dwg and *.dxf reading and saving
- PDF export
VB6 to .NET migration: Strategies, challenges, actuality
Why approach VB6 to .NET migration?
Learn more from our .NET specialists.
Rewriting slow AutoCAD functions
The most labor-intensive part was to rewrite slow AutoCAD functions:
1. Automatic conversion
For successful VB6 conversion, the algorithm producing polylines was rewritten in three simple steps:
- First, VBA was converted to VB6
- The second step was to convert VB6 to VB.NET code by using Visual Studio
- Lastly, we had to convert VB NET to C#
Having conducted partial conversion, we proceeded with the manual migration of several complex algorithms – we couldn’t convert VB to C# with an automatic converter.
2. Manual conversion
To smoothly convert VB to C#, our team:
- Used the BOUNDARY command, but have soon realized it was lacking precision
- Replaced the BOUNDARY command and implemented a more precise algorithm
- Utilized the same algorithm in both standalone application and plugin
3. Tan Tan Radius replacement
We replaced the implemented AutoCAD Circle Tan Tan Radius function and automated polyline generation. After automating this routine, we replaced the native AutoCAD functions OFFSET, TRIM, EXPLODE, PEDIT.
4. Reporting enhancement
Reporting included finding appropriate zoom levels, annotating individual polyline curves, finding templates. These routines are now done with a single mouse click.
5. Unit testing
Unit testing allowed to quickly identify risky cases when the new improvements were breaking file support. What’s more, unit tests also helped correctly handle other situations.
.NET development
Delivering reliable and easy-to-maintain .NET solutions
How we can help
Abto Software, Microsoft Gold Certified Partner, can cover legacy modernization no matter the complexity. From assessment and planning to implementation, our team does everything to eliminate legacy limitations and boost business growth.
Our services perfectly combine proven methodologies, best practices, and innovation.
If you are interested in hiring industry professionals to provide VB6 to .NET migration, we can cover that as well. With extensive domain-specific expertise, our teams can handle VB6 to .NET conversion to modernize insufficient applications and deliver better performance, security, compatibility, and scalability.
Finally ready to approach VB6 migration to .NET?
Trust us with our VB6 to .NET migration strategy and start leveraging greater performance.
By providing:
- Custom desktop, web and mobile development
- Legacy migration and optimization
- Business consulting and analysis
- Project management
And leveraging:
- Artificial intelligence
- Computer vision
- Data Science
- And other advanced technology
We guarantee:
- Reduced time and cost
Properly maintaining and supporting outdated technology requires comprehensive, industry-specific expertise. Delaying migration, you will face troubles finding candidates with the necessary knowledge and experience, which might increase time and cost.
By hiring a software development company with extensive modernization expertise, you can allocate resources more wisely.
- Increased competitiveness
Outdated technology leads to unjustified expenses, security vulnerability, complicated debugging, and more. Delaying modernization causes multiple complex issues decreasing overall business competitiveness.
By approaching a software development firm that has modernization expertise, you can eliminate potential reputational and financial damage.
Along with multiple respective business benefits:
- Improved security
- Better compatibility, flexibility, scalability, and integration
- Reduced risks
- Increased productivity
Contact us for professional VB6 to C# and VB6 to .NET migration services through our website’s contact form.