views:

78

answers:

3

Hi, Is there a library that I can use to convert VB.Net code into C#? There is http://codeconverter.sharpdevelop.net/ but i don't want to use it from a web service.

+8  A: 

Open your assembly in .NET Reflector. Choose language C#. Copy/paste source code to Visual Studio. Try to compile.

abatishchev
Exactly what I do :)
leppie
+4  A: 

There are plenty online services: Telerik provides one, here's one other and one of the best is on developer fusion. But these are all online.

I've had good experiences with Instant C# of Tangible Solutions, they provide good services for each bug you encounter after conversion. Other than that, Turnsharp and many others are available through Google.

If you use Reflector, a few notes: it doesn't translate your source code, but the compiled code. This can make a huge difference in logic inside methods and above all, you loose all your (xml) comments and possibly your file structure (partial classes are not recognized, for instance). Reflector is virtually unusable when it comes to ASPX and inline code. But it is an excellent free tool in all other respects

Abel
A: 

Just download SharpDevelop, it contains the same converter for offline use.

Actually, the SharpDevelop converter is even better than the online converter as it can take a look at your whole project and your references.

The SharpDevelop source code repository also contains the full source code for that website. It's all open source.

Daniel