• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

How can I convert a large vb.net application to C#?

We have just upgraded a vb6 application to VB.Net winforms. Now we want to convert it to C# winforms and re-use the objects or whatever we can re-use in there and finally rebuild it to asp.net mvc.

Is there a tool I can use (open source or free) to convert vb.net to C#? Are there any pitfalls I might encounter during the conversion, like vb.net code that cannot be converted to C#?
0
stylelyf
Asked:
stylelyf
1 Solution
 
AndyAinscowFreelance programmer / ConsultantCommented:
Why do that?
VB.Net and C# both compile to the same intermediate code.
0
 
Éric MoreauSenior .Net ConsultantCommented:
converting Windows Forms to ASP.Net MVC! They are very different beast you know? If your project was correctly architectured, you should be able to reuse the business logic part and the data layer part which should be in DLLs.
0
 
it_saigeDeveloperCommented:
As Andy has pointed out, they do compile to the same intermediate code.  And as Eric pointed out, ASP.NET and WinForms are completely different animals (MVC is not an ASP.NET only architectural pattern).  That being said, yes there are converters that you can use.  Some are free while others cost.  The free ones dont have a problem per se with the conversion one to the other (although the most common issues I see with converters deal with event handlers and array index references).

The best one, however, is not mean to be a converter.  Reflector, since it deals with IL, can reconstruct any .NET assembly into any .NET language you want (although, you can get code artifacts where the code has been obfuscated or otherwise optimized).

Also be warned that the reconstructed code is not refactored, in places you will find that it was been expanded or rendered explicitly; e.g. -

AutoImplemented properties are reconstructed with backing fields.

-saige-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now