VB.NET to C# convertor

This post is mainly self referral, but hack – it might be useful for the random reader as well.


We are converting a few (very small)projects of us from VB.NET 2.0 into C# 2.0. We thought that converting everything manually will take something like 2 hours, but we managed to find an on-line convertor that will cut our work into ~10 minutes. The 10 minutes will be spent on building a new Project as this on-line tool can’t migrate our *.vbproj files into *.csproj files. There are tools on the market that actually support it, but they cost money and therefore recommended only if you migrate big chunks of code\projects\solution.


Our migration process:


1. Create a new C# Project for each VB.NET Project.
2. Create classes files in C# for each VB.NET files.
3. Migrate each VB.NET code via the automatic tool and put the result in the related C# file.
4. Run our Unit Tests.
5. Delete our VB.NET projects (bye bye VB.NET)
6. Smile… :-)


You can find the automatic convertor tool here.

 

Oren Ellenbogen

 

4 thoughts on “VB.NET to C# convertor

  1. 1. What about source cotrolled history? just deleting the VB files seams a bit harsh
    2. SharpDevelop had long have C#-VB.NET converting abilities, since early .NET 1.0. It wouldn’t convert proj files, since it uses a different schema (.combine files or somf’n like that), however, I think there is a way to migrate a vbproj to #develop, then migrate it to c#, then save it as a csproj, but i’m not sure about the last part …

  2. @Egozi – 1. it’s saved in the Source Safe. 2. We don’t need it, it don’t have a lot of code in VB.NET. Maybe ~500 lines.
    @Shani – You don’t convert from one platform or langauge to another just for fun. We simply hate VB.NET, how is that as an excuse? I’m kidding… I’m not going to explain here why C# is better than VB.NET in my eyes. I think that this topic was elaborated all over the web several times before and each person or a team have their opionion and their reasons. We simply prefer C# as we look into our(the team, the product) future… That’s it.

Comments are closed.