views:

5062

answers:

6

Has anyone migrated a VB6 project to .Net with Visual Studio 2010?

I have tested the migration in VS2005, but the resulting .Net code was so messed up, that we decided not to migrate to .Net. So has the VS2010 migration wizard been improved over the wizard in VS2005 or VS2008?

+2  A: 

I would seriously doubt it, VB10 has not introduced any features from VB6 that were not present in VB7, 8 or 9, so there would be no new reasons for them to update their (arguably inadequate) upgrade wizard that did not exist in 2005.

Patrick McDonald
There are some good third-party alternatives to the pathetic built-in migration wizard: Artinsoft's and VBMigration.com. Microsoft UK recommend them. More discussion here with links http://stackoverflow.com/questions/395/how-to-switch-a-large-app-from-vb6-to-vb-net/82200#82200
MarkJ
A: 

Since VS2010 is still in Beta, it's hard to say how the final product is going to perform. Right now, it looks like the Migration code is still a little rocky.

I'm going out on a limb and saying that VS2010 isn't going to be any better at importing something as old as a VB6 project than previous versions. Chances are, no matter what happens, you're going to have to re-write a significant portion of that application to get any benefit out of .NET anyway.

Justin Niessner
+3  A: 

It certainly hasn't in 2008 and I'd be very surprised if it's any different in 2010.

VB6 and VB.net are totally different languages, and MS have never officially endorsed a automatic migration route for anything beyond simple applications. The migration path is non-trivial. There are several companies around that offer migration services, I haven't tried them but my advice would be manage it yourself.

We currently have several apps that are written largely in VB6. Our position is that existing working code is not migrated to .net without a good reason, but all new code must be written in .net (We've actually chosen C#)

What this means is that if we want to add a new feature to an existing VB6 app the feature must be implemented in .net with some interop. Gradually over time are apps are becoming more and more .net and less and less VB. We have 1 app that just has a tiny VB6 component now and the rest is almost entirely in .net thanks to this gradual migration approach. It has worked very well for us. Once we reach a stage where the VB6 portion is minimal, we simple manually convert the remaining code without much cost because there is only a tiny bit left.

Simon P Stevens
There are some good third-party alternatives to the pathetic built-in migration wizard: Artinsoft's and VBMigration.com. Microsoft UK even recommend them. More discussion here. http://stackoverflow.com/questions/638152/best-development-tools-for-upgrading-from-vb6-0
MarkJ
A: 

Visual Studio conversion of VB 6 is spotty at best, due to some of the fundamental language changes. You might find better success looking at a third party tool like VBMigration Partner

Conrad
Quite true. Microsoft UK recommends two third party migration tools as better than the built-in VB.NET upgrade wizard - Artinsoft and CodeArchitects VBMigration Partner. Here's the link http://msdn.microsoft.com/en-gb/dd408373.aspx
MarkJ
A: 

At this point I wouldn't expect the migration tools to get any better. The need for this will only decrease over time, and is probably already pretty low.

I also think it would be easy to make an argument that any code in VB6 is old enough that it warrants major refactoring, anyway.

Jon B
I have to disagree strongly with most of this. In fact one of the top migration tools (vbmigration.com) is only just over a year old and is being heavily developed. The main competitor, from Artinsoft, is also still being extended (latest version was version 3, May 09). And Microsoft's official advice is that rewriting from scratch "is far more costly and difficult to do well [than converting] ... we would only recommend this approach for a small number of situations" References here http://stackoverflow.com/questions/395/how-to-switch-a-large-app-from-vb6-to-vb-net/82200#82200
MarkJ
+3  A: 

As many have pointed out, I very much doubt there will have been much more work done on the VB6 upgrade wizard. The VB6 upgrade wizard in Visual Studio is actually a cut down version of ArtinSoft's Visual Basic Upgrade Companion.

Upgrading a non-trivial VB6 application is a fairly time consuming task but there are a number of great articles such as this one that can help smooth out the road for you:

Refactor Your Way to Migration Success (VSM)

A combination of good methodology and professional tools such as those by ArtinSoft and Code Architects will hopefully make for a successful result.

Kev
+1. Can I also point to some good discussion elsewhere on StackOverflow, e.g. in this question http://stackoverflow.com/questions/638152/best-development-tools-for-upgrading-from-vb6-0
MarkJ