Geeks With Blogs
DevDevin

I'm not implying that you shouldn't buy the full version VB.NET to C# conversion products if they have the functionality that you really need. However, I do think it would be silly not to take advantage of the free demo versions and/or the other free tools available for doing this if it will get the job done without having to purchase anything. So here are a few of the options I've found for converting VB.NET code to C# for free:

TransKing (free demo version allows 600 lines of code per file)
http://www.e-iceblue.com/

C-Sharpener (free demo version allows 500 lines per project)
http://www.elegancetech.com/

VBConversions (free demo version allows 600 lines per project)
http://www.vbconversions.com/

Instant C# (free demo version allows 500 lines per project or 100 lines per ASP.NET snippet)
http://www.tangiblesoftwaresolutions.com/

And last, but definitely not least, is the free online converter from Carlos Ag that will let you either convert a file, a snippet of code you paste, or code as you type it. It is pretty cool.
http://www.carlosag.net/Tools/CodeTranslator/

UPDATE: I just realized that SharpDevelop--one of the Vistual Studio IDE alternatives for developing on the .NET platform--has an integrated C# to VB.NET and VB.NET to C# converter! Plus, it has some other cool features like NUnit integration support and XML documentation preview. Oh, and the IDE is downloadable and free.
http://www.icsharpcode.net/opensource/sd/

UPDATE 2: After using SharpDevelop to convert several pages of VB.NET to C#, I have noted some of its flaws: it changes select case statements into if blocks instead of the equivalent switch statements, it will specify the type in for loops regardless of whether the original code declared it inline or above the loop, and it doesn't preserve comments. Yes, there are some developers out there who actually document their code and if they've gone through the trouble to write it let's help preserve it.  A few other funny kinks you have to watch out for come more with the territory of converting from VB.NET to C# rather than a fault of the program itself: methods and arrays are hard to distinguish in VB.NET since both use parens, so you will have to convert the array parens to square brackets on your own. Also, an if not x = 1 statement translates into if(!x==1), which is just awkward to read. It makes much more sense to interpret when you retype it as if(x!=1).

Posted on Tuesday, October 18, 2005 8:13 AM ASP.NET , .NET | Back to top

Copyright © Devin A. Rychetnik | Powered by: GeeksWithBlogs.net