i want to migrate one of the application from vb6 to .net with visual studio 2010.At present the application is windows based application. i want to make web application. i guess i have to rewrite the code in .net. could you please advice me while i rewrite the code in .net.
views:
84answers:
4It depends very highly on how well-structured the original application is. A well-structured application could be translated from desktop to web with a fairly high amount of reuse. Unfortunately, the vast majority of VB6-era code is not well-structured and that makes life much harder for you.
Visual Studio is able to import a VB6 project and convert it to VB.NET, but the mapping is not perfect. Coupled with the badly-structured code that I mentioned above that's common to a lot of VB6 code, you may be better off just totally scrapping the original project and starting anew.
It's highly dependent on a lot of factors, of course. You might be lucky and be working with one of those rare gems: a well-structured VB6 project with clear separation of views and code.
If your VB6 application is composed of multiple COM objects with clean interfaces, then you should be able to reuse those components which do not touch the UI. You might want to take advantage of the VB6 expertise at your company to separate any UI code from business logic. The business logic can then be reused in the web application.
There's lots of advice on strategies for conversion. One strategy that might work well (as John said) is to use Interop to mix a VB6 back-end with a .Net web front end.
Some other resources:
- Check out the other questions here tagged vb6-migration.
- I highly recommend Microsoft's page about different conversion strategies.
- Consider the commercial migration tools especially if you are short of developer time.
- Artinsoft's upgrade companion (converts to c# and vb.net)
- VBMigration partner (converts to vb.net)
VBDepend can help to understand the existing vb6 code before migration, and accelerate the process during migration.