Why is it more difficult to migrate VB6 to C# than to VB.NET?

16. November 2007 13:46 by jpena in General  //  Tags:   //   Comments (17)
One of the questions that most people ask when preparing for a Visual Basic 6.0 migration to .NET has to do with the difficulty level of migrating an application to C# compared to VB.NET. Although the Visual Basic Upgrade Companion product can migrate VB6 code to both VB.NET and C#, and both languages are first-class citizens in the .NET world, having access to all the resources provided by the .NET Framework, there are some key differences that will make a migration to C# demand more manual effort and changes.  The following are two of these differences:
  • C# is strictly typed as opposed to VB6 and there’s no way around it.  Invoking a property or method from an Object variable that is meant to be instantiated to a different type at runtime would require a type-cast; otherwise the compiler will throw an error.  Therefore, many late-bound operations and unsafe operations (such as assigning the value of a Long variable to an Integer variable) that unfortunately were common in VB6, will generate compilation errors.  This will not happen in VB.NET unless you turn Option Strict on, which is turned off by default.
  • In C#, only Structured Error Handling (“Try Catch”) is allowed.  This means that any error-handling code that could not be converted to “Try Catch” by VBUC will have to be fixed manually, implying an important amount of manual work in some projects (especially if statements such as “On Error Resume” and “On Error Resume Next” are used in the VB6 code).  On the other hand, VB.NET still supports Unstructured Error Handling (“On Error GoTo”) for compatibility with migrated applications, which will reduce the amount of manual work if you are in a hurry.  For VB.NET migrations, VBUC can disable the conversion of “On Error GoTo” to “Try Catch” to speed up the migration process and reduce manual changes.
Naturally, strongly-typed and well-structured code is preferable.  However, this increases the amount of manual work that is needed to achieve Functional Equivalence. More information on migrating Visual Basic 6.0 to C# can be found in the ArtinSoft website: http://www.artinsoft.com/vbc_csharpgen.aspx

Comments (17) -

Anonymous
Anonymous
11/23/2007 12:33:56 AM #

Its good coverage.... But loking for more on Try{}catch{}.. Thanx

Anonymous
Anonymous
11/23/2007 12:33:56 AM #

Its good coverage.... But loking for more on Try{}catch{}.. Thanx

Anonymous
Anonymous
11/23/2007 12:33:56 AM #

Its good coverage.... But loking for more on Try{}catch{}.. Thanx

Anonymous
Anonymous
2/4/2009 6:39:41 PM #

Really good.. Short and Sweet Smile


Anonymous
Anonymous
2/4/2009 6:39:41 PM #

Really good.. Short and Sweet Smile


Anonymous
Anonymous
2/4/2009 6:39:41 PM #

Really good.. Short and Sweet Smile


Anonymous
Anonymous
7/4/2010 11:21:46 PM #

Really useful to start with.


Anonymous
Anonymous
7/4/2010 11:21:46 PM #

Really useful to start with.


Anonymous
Anonymous
7/4/2010 11:21:46 PM #

Really useful to start with.


Anonymous
Anonymous
7/4/2010 11:34:05 PM #

Useful


Anonymous
Anonymous
7/4/2010 11:34:05 PM #

Useful


Anonymous
Anonymous
7/4/2010 11:34:05 PM #

Useful


Anonymous
Anonymous
10/13/2010 8:24:17 PM #

What about the .net DLR and dynamic support in .net 4 as a solution for the strictly typed problem


Anonymous
Anonymous
10/13/2010 8:24:17 PM #

What about the .net DLR and dynamic support in .net 4 as a solution for the strictly typed problem


Anonymous
Anonymous
10/13/2010 8:24:17 PM #

What about the .net DLR and dynamic support in .net 4 as a solution for the strictly typed problem


dfgsddd
dfgsddd
7/13/2012 1:59:32 AM #

sadfdssdfdsfsdfadsfasdfsfdasfd

dfgsdddd
dfgsdddd
7/13/2012 2:07:39 AM #

content

derte
derte
10/11/2012 11:05:59 PM #

www.officialcowboysjerseysonline.com/...28_47.html Dallas Cowboys #47
www.officialcowboysjerseysonline.com/...28_49.html Dallas Cowboys #49
www.officialcowboysjerseysonline.com/...28_39.html Dallas Cowboys #39
www.officialcowboysjerseysonline.com/...28_44.html Dallas Cowboys #44
www.officialcowboysjerseysonline.com/...28_48.html Dallas Cowboys #48
www.officialcowboysjerseysonline.com/...28_46.html Dallas Cowboys #46
www.officialcowboysjerseysonline.com/...28_47.html Authentic Jersey Shop
www.officialcowboysjerseysonline.com/...28_49.html Dallas Cowboys Jersey 2012
www.officialcowboysjerseysonline.com/...28_39.html Nike Dallas Cowboys Jersey
www.officialcowboysjerseysonline.com/...28_32.html New Dallas Cowboys Jersey
www.officialcowboysjerseysonline.com/...28_44.html Ny Jersey Sale
www.officialcowboysjerseysonline.com/...28_41.html Dallas Cowboys Jersey Sale
www.officialcowboysjerseysonline.com/...28_51.html Cowboys Uniform Sale
www.officialcowboysjerseysonline.com/...28_48.html Official jerseys For Sale
www.officialcowboysjerseysonline.com/...28_45.html Nfl Jersey On Sale
www.officialcowboysjerseysonline.com/...28_46.html personalized cowboys Jersey
www.officialcowboysjerseysonline.com/...-c-72.html Throwback Jersey for Sale
www.officialcowboysjerseysonline.com/...-c-71.html Custom Dallas Cowboys Jersey
http://www.officialcowboysjerseysonline.com/ Official Cowboys Jerseys
www.officialcowboysjerseysonline.com/...p-522.html Nike Blue Jersey Sale
www.officialcowboysjerseysonline.com/...p-528.html Elite Blue Jersey
www.officialcowboysjerseysonline.com/...p-518.html New Cowboys Jersey Blue
www.officialcowboysjerseysonline.com/...p-406.html Nfl White Jersey Sale
www.officialcowboysjerseysonline.com/...p-508.html Authentic Blue Jersey 2012
www.officialcowboysjerseysonline.com/...p-272.html White Cowboys Jersey Sale
www.officialcowboysjerseysonline.com/...p-407.html White Jersey 2012
www.officialcowboysjerseysonline.com/...p-509.html Nfl Blue Jersey 2012
www.officialcowboysjerseysonline.com/...p-410.html NFL Jersey On Sale
www.officialcowboysjerseysonline.com/...p-512.html Blue Cowboys Jersey Sale
www.officialcowboysjerseysonline.com/...p-526.html Elite Cowboys Jersey Sale
www.officialcowboysjerseysonline.com/...p-642.html Official Womens Cowboys Jersey
www.officialcowboysjerseysonline.com/...p-570.html Official Kids Cowboys Jersey
http://www.officialcowboysjerseysonline.com More information
http://www.officialcowboysjerseysonline.com

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading