views:

87

answers:

8

Can somebody please show me a site where there is good conversion available from vb.net to c#?

I appreciate your help. Thank you!

+2  A: 

Developer fusion usually works fine for me:

http://www.developerfusion.com/tools/convert/vb-to-csharp/

ho1
thank you for your answer!
+2  A: 

http://www.developerfusion.com/tools/convert/vb-to-csharp/

Note that every automated conversion tools do not take advantage of the language intrinsics so if you want a real conversion doing it manually is the only way to get a quality code result.

Darin Dimitrov
An interesting link. Is there a summary of what it CAN'T do?
Carlos
It can't take advantage of some language specific features like for example the `yield` keyword in C# to generate `IEnumerable<T>` at compile time which has no equivalent in VB.NET.
Darin Dimitrov
Used it many times for conversions of VB snippets.
Chris
A: 

This is by far the best free tool that I have used. Please note that from my experience none of them are perfect:

Developer Fusion - VB to C# Conversion

I hope this helps.

lucifer
-1 Google farming, are we?
Pete Kirkham
What? What the hell is google farming?
lucifer
I right clicked on the link and selected Copy Shortcut. Wtf is wrong with that?
lucifer
It contains tracking information for your google account rather than being a direct link, which cause anyone else clicking on it to be counted towards either your ad sense click-throughs. You probably don't have adsense, but if you did, you'd be farming money of SO links.
Pete Kirkham
I'm sorry for over reacting. I don't have any Google accounts at all. That's weird. Ummmmm.... I'll change the link, so it's just a normal one. :)
lucifer
@Pete Kirkham; Thanks for tellin'me about the Google Farming thing. Nice to know :)
lucifer
A: 

As a free alternative that converts your entire project at once (including references, resources and file paths), Reflector can do it for you.

Just open your compiled C# assembly (preferably in debug mode to preserve the original structure), choose "visual basic" from the combo box on top, right click the assembly, choose export and let it do the magic for you. You'll get the full compilable vs.net project.

Blindy
+1  A: 

You can use SharpDevelop to convert entire projects, or for snippets and single files use the handy online converter (based on the same converter used in SharpDevelop): http://codeconverter.sharpdevelop.net/SnippetConverter.aspx

allonym
This one works well.
Chris
A: 

You can use tools like Developer fusion which are good, but I think the most correct result will be if you will compile your VB.NET code, and use Reflector to decompile it in C#.

TTT
A: 

Telerik also provide a convertor VB > C# and vice versa.

http://converter.telerik.com/

DivanMoller
A: 

Another alternative is to use the code translation tool from carlosag.net. The tool supports translation from VB.NET to C# and from C# to VB.NET along with the ability to colorize the output .

Good luck, and hope this helps some.

Chris