I have a VB6 Forms application and want to convert to .Net Core WinForms. I know conversion tools are available that make that claim. However, I'm looking for recommendations or first hand experience in doing this.
-
Sorry, but you don't have "VB6 WinForms". WinForms is part of VB.Net, not VB6. If you're using VB6, then they are VB6 forms, not VB.Net WinForms. So some clarification on the question is needed. But, this question is off topic anyway since it's asking for product recommendations. – MarkL Feb 04 '20 at 22:00
-
1Does this answer your question? [Conversion tool comparisons for visual basic 6.0](https://stackoverflow.com/questions/718780/conversion-tool-comparisons-for-visual-basic-6-0) – StayOnTarget Feb 05 '20 at 13:31
-
1Although there are a lot of closed questions on this topic I think you will actually still find some decent information in them if you read around the subject. My 2c is that it is worth starting off with an automated tool, but then be prepared to do a lot of (mostly easy) manual cleanup. But in most situations I have found a general rewrite has not been needed (though might be beneficial). – StayOnTarget Feb 05 '20 at 13:33
-
I would not suggest going from VB6 to Core. It seems likely to be too big of a jump. – jmoreno Feb 05 '20 at 14:14
-
Your need to rewrite from scratch. If you use conversion tools you will end up spending even more time debugging the generated errors. In addition, the way VB6 code is structured is not true OOP and converting it line by line would not be a good practice. – amindomeniko Feb 05 '20 at 22:01
-
I've looked into VB6 to .Net WinForms migration in the past, but not to .Net Core WinForms. There are third party automatic tools and I heard very good things about them. They could be useful if you have a big VB6 codebase. I don't know whether they now support .Net Core WinForms. An obvious option is to migrate to .Net WinForms and then later to .Net Core WinForms. I suggest reading some of the questions on the [`vb6-migration`](https://stackoverflow.com/tags/vb6-migration/info) tag. There are many different opinions about the best strategy (heroic massive rewrite, or buy automatic tools?). – MarkJ Feb 06 '20 at 11:40
-
1I disagree that code conversion is automatically not a good option. It might or might not be. It is pretty easy to run the converter in Visual Studio 2008 and see what results you get. Typically you'll get loads of identical errors and some unique issues; its the unique ones that require careful attention. If they are easily fixed by substituting something from .NET that's a good sign. If not then a significant rewrite of at least big portions seems likely. I've converted lots of code this way and it has always seemed to be a net benefit vs. rewriting from scratch. \ – StayOnTarget Feb 07 '20 at 12:48
-
Also, incremental refactoring often seems better than rewriting from scratch (IMHO) which is another reason I prefer to get existing code into .NET ASAP and then work from there. – StayOnTarget Feb 07 '20 at 12:49
-
How big is the application? For small and medium-size applications, the tool bundled with VB.NET 2008 is sufficient. It's not perfect, but in my personal experience, it's good enough. – R.J. Dunnill Feb 19 '20 at 18:15
2 Answers
Manual may be best, but if you're looking for an automated route, I would suggest
- VB6 to VB.NET WinForms (.NET Framework)
- VB.NET to C# (.NET Framework)
- Upgrade to .NET Core
I do not have any experience with #1, VB6 to VB.NET.
For #2 check out this project https://github.com/icsharpcode/CodeConverter. It works very well.
For #3, Microsoft has a try-convert project to upgrade .NET Framework projects to .NET Core. It has worked flawlessly for me. https://github.com/dotnet/try-convert

- 399
- 3
- 13
I just converted a decent sized app from VB6 to C#. The biggest challenge for me was the third party controls. Most tools can't manage those as most old controls are either discontinued or the interfaces are so wildly different it made no sense to use a tool.
I ended up just recreating all the forms using modern controls first. I would then just paste the old VB6 code where is made sense and worked my way through converting the logic to C#. In some cases I literally printed files to paper and read through them and typed in the C# code.
I wanted to take advantage of the .net programming model so I rewrote a lot and improved the function and readability of the code.
I have used tools and while they do help, I didn't feel it really saved me a lot of time. My "brute force" method helped me understand the application much better and helped me sort through errors and bugs easier.
In my experience it's worth the effort doing it manually. There really is no shortcut if you want to do a proper job.

- 136
- 7