I\'m porting a Java library to C#. I\'m using Visual Studio 2008, so I don\'t have the discontinued Microsoft Java Language Conversion Assistant program (JLCA).
My a
One more quick-and-dirty idea: you could use IKVM to convert the Java jar to a .NET assembly, then use Reflector--combined with the FileDisassembler Add-in--to disassemble it into a Visual C# project.
(By the way, I haven't actually used IKVM--anyone care to vouch that this process would work?)
I'm not sure if it is really the best way to convert the code line by line especially if the obstacles become overwhelming. Of course the Java code gives you a guideline and the basic structure but I think at the end the most important thing is that the library does provide the same functionality like it does in Java.
Your doing it in the only sane way you can...the biggest help will be this document from Dare Obasanjo that lists the differences between the two languages:
http://www.25hoursaday.com/CsharpVsJava.html
BTW, change all getter and setter methods into properties...No need to have the C# library function just the same as the java library unless you are going for perfect interface compatibility.
If you have a small amount of code then a line by line conversion is probably the most efficient.
If you have a large amount of code I would consider:
I heard something the other day about a .net version of Java. If such a monster was available, would you just be able to compile the java source into .net intermediate libraries?
Couple other options worth noting:
J# is Microsoft's Java language implementation on .NET. You can access Java libraries (up to version 1.4*, anyways). *actually Java 1.1.4 for java.io/lang, and 1.2 for java.util + keep in mind that J# end of life is ~ 2015-2017 for J# 2.0 redist
Mono's IKVM also runs Java on the CLR, with access to other .NET programs.
Microsoft Visual Studio 2005 comes with a "Java language conversion assistant" that converts Java programs to C# programs automatically for you.