The “Burning Platform”
Visual Basic 6.0 has been unsupported since 2008. While the runtime still works on Windows 10/11, it is a ticking time bomb for security and compliance.
Technical Deep Dive
1. COM Interop vs. Native Rewrite
- The Trap: Using COM Interop to keep old VB6 DLLs running alongside new .NET code. This creates “DLL Hell” and memory leaks.
- The Fix: Aim for a “Clean Break”. Rewrite the DLLs in C# Standard 2.0 so they can be used by both .NET Framework and .NET Core.
2. Data Access: ADO to Entity Framework
VB6 used ADO (Recordset). .NET uses ADO.NET or Entity Framework (ORM).
- Challenge:
Recordsetwas often passed around the entire application, tightly coupling UI to Database. - Solution: Create Data Transfer Objects (DTOs) to pass data between layers. Do not try to emulate the
Recordsetobject in C#; it kills performance.
3. UI Modernization: WinForms vs. Web
- WinForms: Closest to VB6. Easiest migration path but still a “desktop” app.
- Web (Blazor/React): Harder migration but future-proof. Requires moving logic from
Form_Loadto API controllers.
Recommendation: If the app is internal and data-heavy, Blazor is an excellent middle ground, offering desktop-like performance in a browser. If the app looks different or removes a beloved shortcut key, expect rebellion.
How to Choose a VB6 to .NET Migration Partner
If you want automated code conversion: Mobilize.Net. Their VBUC tool is the industry standard for automated translation (handles 95% of syntax).
If you need a complete web rewrite: EPAM Systems. They specialize in re-engineering desktop apps into cloud-native web platforms (React/Angular + .NET Core).
If you need cost-effective refactoring: N-iX. They provide strong manual refactoring services to clean up the “spaghetti code” post-migration.
If you need long-term legacy management: Fresche. They offer a holistic approach to managing and modernizing legacy portfolios.
If you have a small budget/app: Feathersoft. Good for straightforward porting projects with minimal architectural changes.
Red flags:
- Vendors who promise “100% automated migration” (the last 5% takes 50% of the time)
- No plan for replacing ActiveX/OCX controls (grids, charts)
- Suggesting to keep using COM Interop indefinitely
- Ignoring the “Event Loop” architectural difference (VB6 vs .NET)
When to Hire VB6 to .NET Migration Services
1. Windows OS Compatibility Risks
VB6 runtime is technically supported on Windows 10/11, but the IDE is not. You cannot install the development environment on modern machines without hacks.
Trigger: Developers cannot compile the code on Windows 11 laptops; reliance on a single “build machine” running Windows XP/7.
2. Security & Compliance Failures
Your VB6 app uses old encryption libraries (MD5, SHA1) or cannot support TLS 1.2+. It fails modern security audits (SOC2, PCI-DSS).
Trigger: Security audit finding “Critical” due to weak crypto; inability to integrate with modern SSO (Okta/Azure AD).
3. Dependency Rot (ActiveX/OCX)
Your app relies on a 3rd party grid control (e.g., TrueDBGrid 6.0) from a vendor that went out of business in 2005. You lost the installer keys.
Trigger: Cannot reinstall the app on new PCs because OCX registration fails; “Class not registered” errors.
4. Integration Roadblocks
The business wants to expose app data to a mobile app or web portal. VB6 has no native REST API support. You’re building fragile “file drop” integrations.
Trigger: Business demands a mobile dashboard; integration projects take 3x longer than expected due to legacy hacks.
5. Talent Scarcity
You have one developer named “Bob” who knows the codebase. Bob is retiring in 6 months. No new hire wants to touch VB6.
Trigger: “Bus factor” of 1; inability to hire replacement developers.
Total Cost of Ownership: VB6 vs .NET
| Line Item | % of Total Budget | Example ($450K Project) |
|---|---|---|
| Code Conversion (Automated + Manual fix) | 25-30% | $112.5K-$135K |
| UI Replacement (WinForms/WPF/Web) | 30-40% | $135K-$180K |
| 3rd Party Control Replacement (Grids/Charts) | 10-15% | $45K-$67.5K |
| Testing (Regression & UAT) | 15-20% | $67.5K-$90K |
| Database Modernization (ADO → EF Core) | 10-15% | $45K-$67.5K |
Hidden Costs NOT Included:
- Report Rewrites: Crystal Reports 8.5 files often need complete recreation in SSRS or PowerBI.
- Installer Logic: Rewriting complex InstallShield scripts into MSIX or ClickOnce.
- Help Files: Converting
.hlp(WinHelp) files which are no longer supported to.chmor web-based help.
Break-Even Analysis:
- Median Investment: $450K
- Maintenance Savings: $80K/year (cheaper .NET devs vs VB6 contractors)
- Risk Avoidance: Priceless (avoiding business stoppage if “Bob” leaves)
- Break-Even: 3-4 years (Longer ROI, but driven by risk mitigation, not just cost)
VB6 to .NET Migration Roadmap
Phase 1: Assessment & Inventory (Weeks 1-4)
Activities:
- Scan codebase for LOC, form count, and 3rd party dependencies (OCX/DLLs)
- Identify “dead code” (usually 30% of VB6 apps is unused)
- Select target architecture (Desktop WinForms vs Web Blazor/React)
- Proof of Concept (POC): Migrate 1 complex form end-to-end
Deliverables:
- Inventory spreadsheet with complexity scoring
- POC application
- Migration strategy document
Phase 2: Automated Conversion & Fix (Months 2-6)
Activities:
- Run automated tool (VBUC) to generate C# code
- Fix compilation errors (thousands of them)
- Replace unsupported keywords (
On Error Resume Next,GoSub) - Replace 3rd party controls with .NET equivalents (Telerik/DevExpress)
Risks:
- “The Last 10%”: Automated tools get you 90% there, but the last 10% (graphics, printing, hardware calls) is hard.
Deliverables:
- Compilable C# solution
- UI that renders (even if logic is broken)
Phase 3: Logic Refactoring & Data Access (Months 7-10)
Activities:
- Rewrite ADO
Recordsetlogic to Entity Framework or Dapper - Extract business logic from UI code-behind (
Button_Click) into Services - Implement Unit Tests for critical calculations (impossible in VB6)
Risks:
- Subtle logic bugs (e.g., VB6 1-based arrays vs C# 0-based arrays)
- Date/Currency formatting differences
Deliverables:
- Functional application connected to DB
- Unit test suite covering core logic
Phase 4: QA & UAT (Months 11-14)
Activities:
- Parallel testing: Run VB6 and .NET apps side-by-side
- Compare outputs (reports, calculations) bit-by-bit
- Performance tuning (garbage collection tuning, query optimization)
Deliverables:
- Signed-off UAT
- Production deployment plan
Post-Migration: Best Practices
Months 1-3: Stabilization
- Memory Management: Watch for memory leaks. VB6 used deterministic destruction (COM); .NET uses Garbage Collection. You may need to manually
Dispose()resources. - User Training: If you moved to Web, train users on browser behaviors (back button, refresh).
Months 4-6: Modernization
- CI/CD: Set up Azure DevOps/GitHub Actions pipelines (impossible with VB6).
- Containerization: If you migrated to .NET Core/Web, containerize with Docker for easy deployment.
Expanded FAQs
Should we migrate to WinForms, WPF, or Web?
Answer: WinForms: Fastest/Cheapest (closest to VB6 model), but “dead end” tech. WPF: Better styling, but steep learning curve (XAML). Web (Blazor/React): Best for future-proofing and remote access, but most expensive (stateless architecture change). Recommendation: If it’s a back-office data entry app, Blazor is the sweet spot.
Can we keep the database as is?
Answer: Yes, usually. You can keep the SQL Server/Oracle DB structure. However, you should replace the data access layer (ADO) in the code. Don’t use ADODB.Recordset in .NET via COM Interop—it’s slow and buggy. Rewrite using ADO.NET or Dapper.
What about “On Error Resume Next”?
Answer: This VB6 command suppresses all errors and continues execution. It is the root of many hidden bugs. Automated tools often translate this to try { ... } catch { } (swallowing errors). You MUST manually review these blocks to implement proper error handling, or your .NET app will fail silently.
How do we handle 3rd party controls (ActiveX)?
Answer: You cannot use 32-bit ActiveX controls in a 64-bit .NET app reliably. You must replace them. Vendors like Telerik, DevExpress, and Infragistics have .NET equivalents for most grids and charts. Budget significant time for re-wiring the events and properties of these new controls.
Is a “Big Bang” rewrite better?
Answer: Almost never. Rewriting from scratch without looking at the old code leads to “Second System Effect” (over-engineering) and missing critical business rules hidden in the spaghetti code. We recommend a Port-then-Refactor approach: Port the code to C# first (even if ugly), verify it works, THEN refactor it.