Results 1 to 4 of 4

Thread: Convert VB.NET to C#.....

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Convert VB.NET to C#.....

    Ok, those of you that have been frequenting the forum know that I am converting a VB6 project to VB.NET using the upgrade wizard thing in Visual Studio.NET. I have successfully used the wizard to convert the project to its initial beginning state from VB6 to VB.NET.

    The next question is.....Should I now try to go ahead and convert it to C# as it is before editing it and then begin editing in C#......or finish editing it in VB.NET and get it running before converting to C#.

    I know some responses will be to simply rewrite from VB6 to C#, but consider that this project has over 40,000 lines of code and multiple forms and modules. Even with all the "Upgrade warnings" and other messages the wizard seems to save a lot of time in that you do not have to recreate your forms, textboxes, labels, a lot of code, etc....etc....

    If I were going to convert a VB.NET project to C#.....what is the best way to go about it?

    Thanks!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    First , activate Option Strict On , and try to optimize the code in VB.NET . C# is strongly typed language . Why don't you try to use any of these VB.NET to C# converter .

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I understand what you are saying, and the upgrade wizard will give you forms, which is nice, but you don't understand what we are saying about the upgrade wizard.

    If you use the upgrade wizard, your application will not take advantage of the .NET framework. Sure, it will be in VB.NET, but it won't take advantage of anything .NET specific that can reduce the amount of code.

    Take for example form resize code you probably have in your VB6 forms. You probably don't even need that code anymore in a .NET application because controls have Anchor properties. The wizard doesn't do that translation, it doesn't know.

    Also, if you used classic ADO to access databases, it is still going ot use those COM references, so you still have your DLL hell issues as well as you just added an interop class overtop to add some more overhead.

    Really, you might as well leave the app as a VB6 application. A hand coded port is the only way to take advantage of the .NET platform.

  4. #4
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    The best way to approach converting a VB6 project to VB.NET or C# is to get your head around the business processes in your program and then translate that functionality into .NET specific functionality. It may sound like a long arduous process (it is btw), but the end result will be an actual .NET program not some facade generated by the wizard. Not to mention actually having the experience of writing that code yourself.
    Whadayamean it doesn't work....
    It works fine on my machine!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width