VB6 => C#.NET

  • Thread starter Thread starter Just D
  • Start date Start date
J

Just D

Hi,

Last time I asked about it over a year ago.

Did anybody write or maybe somebody knows if the program exists to convert
the VB6 source codes (mainly classes, not forms) to C# classes? Any
information about any program including commercial would be appreciated.

We're having about 500'000 lines of VB6 code that should be converted to C#
ASAP. That's a highest priority for us now.

Thanks,
Dmitri
 
There are a couple of converters out there that are somewhat ok. None of
them are perfect though. One of them is BabbelFisken. Although, it hasn't
been updated in a LONG time. The url is
http://w1.311.telia.com/~u31115556/zip/MyUtils/BabbelFisken/Zexedir.zip

Also, there is InstantCSharp, but you will have to first upgrade your VB6
code to VB.NET, make sure it is correct and compiles, then pass it to
InstantCSharp.

There is also an online VB.NET to C# converter at
http://www.developerfusion.com/utilities/convertvbtocsharp.aspx
I haven't tried that one at all.

And lastly, there is #develop (http://www.icsharpcode.net), which is an
open-source alternative to Visual Studio.NET.

All in all, there is no 100% converter available. There probably never will
be.

HTH,

Kyril
 
As Kyril said, Instant C# converts VB.NET code to C# (even though a
fairly high percentage of VB6 code will be converted successfully in
the snippet converter portion of our tool).

We recommend going from VB6 to VB.NET in a 2-step process: convert
first to VB.NET using Microsoft's VB Upgrade Wizard and then use a
converter such as Instant C#. The VB Upgrade Wizard does a good job
of getting your code to work in the .NET environment. Once this is
done, the conversion to C# is far less risky since you've isolated
any possible discrepancies to either the VB.NET upgrade or the C#
conversion.

In our consulting work, we actually divide the process into 4 steps:

1. Prepare the VB6 app for the best possible upgrade to VB.NET (e.g.,
transform 1-based arrays to 0-based arrays)
2. Convert to VB.NET and run comprehensive tests
3. Prepare the VB.NET app for the best possible conversion to C#
(e.g., setting Option Strict)
4. Convert to C# and run comprehensive tests
 
I'll throw out a provacative comment here for kicking around. If you're just
converting syntax, why bother? .NET is a new programming paradigm. By just
converting syntax you're missing all the language enhancements and reasons
to use .NET. To get the benefits of .NET most VB6 programs will need to be
re-designed.

Like I said, just throwing it out there. If management is mandating this
conversion then you have no choice. I agree with the other posts, there
won't be any single conversion tool that can do it all. You'll have to code
the rough edges.

good luck,
kevin aubuchon
 
Kevin Aubuchonwrote:
I'll throw out a provacative comment here for kicking around. If
you're just
converting syntax, why bother? .NET is a new programming paradigm. By just
converting syntax you're missing all the language enhancements and reasons
to use .NET. To get the benefits of .NET most VB6 programs will need to be
re-designed.

Like I said, just throwing it out there. If management is mandating this
conversion then you have no choice. I agree with the other posts, there
won't be any single conversion tool that can do it all. You'll have to code
the rough edges.

good luck,
kevin aubuchon

Yes, to get all the benefit, a lot of redesign may be required.
However, I think there's a lot to be said for doing things in steps.
Convert and ensure it's functioning correctly, then you have a base to
start refactoring from. Trying to do it all at once (redesign and
rewriting from scratch) is much more expensive if you're VB6 code
base is relatively solid. Don't throw all that blood and sweat away
- convert it and refactor/redesign it in small steps.

About your second point: there is no conversion tool that can truly do
100%, but you may be surprised at how much can be done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top