Migrate the VJ# project to C# project RRS feed

  • Question

  • Hello All, Needs help in migrating a class library project written in VJ# into C# project. Since Microsoft dropped their support for the VJ# from VS2005, Couldn't able to make use of latest features of the .net framework and C#. Searched across the web, But couldn't able to find any best tool/approach to completely migrated the VJ# code base to C# code base. Tried the below tools for the conversion

    1. JLCA 3.0(comes with VS2005) - Didn't able to detect the *.jsl files, But only detecting the  *.java files.  Hence, renamed all *.jsl files into *.java files and then finally able converted into a C# project.
    2. Java to C# converter(Tangible Solutions) - Tried free edition that converts up to 100 lines of code.

    Both tools are equally good, if not best.  However, couldn't find any tool that take input as *.jsl file and convert into *.cs file.

    My VJ# projects are relatively huge and need to migrate them into C# projects.  Needs your help on this. Thanks in advance.

    Friday, July 24, 2020 4:59 PM

All replies

  • I'm confused as to what you have. VJ# is Java for .NET. JSL is not VJ#. I googled it and found that it was from SAS and isn't Java either. So I wouldn't expect VJ# to have anything to do with this. If a JSL file is really just Java then renaming to .java should be fine.

    To be honest you're going to end up doing most of this by hand. There is simply too many differences to convert between the 2 automatically. I have used Tangible Software's C++ to C# converters for over a decade so I would strongly recommend them. However every app is different and there is no way to convert 100% of the code correctly. However if you run into issues then I have found TS to be very, very quick on resolving issues. In my experience I post a problem and they generally have a fix within a couple of days (if fixable). I would recommend you give them a try. They also monitor this forum so I wouldn't be surprised if you don't get a response from them here.

    In my experience the best thing to do is convert the entire project into a new folder and then comment out all code and/or stub it until you can get it to compile. Then start cleaning up and fixing issues and recompiling. At some point you can start running it to see what is broken but that could be a while.

    Alternatively VJ# isn't supported anymore but that doesn't mean the code doesn't work. You could also try loading the VJ# assembly into a disassembler like Telerik's JustDecompile. I've never tried it but if it loads then there was an option to generate the equivalent C# code. It isn't going to be pretty at all and won't work directly but it is also a start.

    Or just start building out a new C# structure that mimics the existing functionality. Call into the VJ# assembly for pieces you haven't migrated yet and slowly start replacing VJ# stuff with the C# equivalent. It'll take a while but let's you replace only portions of the code as you go along.

    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, July 25, 2020 4:16 PM
  • Thank you for the quick response Michael.  You are correct that Visual J#(VJ#) is java for .Net that created by Microsoft to lure the java developers to .Net platform.

    JSL is the extension of the source code files in the VJ# project. Similar to "CS" that is the extension of source code files of C# project.

    I've tried the free edition of Java to C# converter(Tangible Solutions). Its pretty good. But it only support up to 100 lines of code on the free edition.  Like you mentioned, Even if i converted the V# code to C#, it'd take line by line verification. Because, sometimes it omit some critical methods while converting. And it leads to compilation errors and other problems.

    For now, I've been using the JLCA 3.0(comes with VS2005) to convert the entire VJ# project to C# project. And then I manually check each cs files line by line. Its painstaking process taking long time. But I've no choice.
    • Edited by Homur Saturday, July 25, 2020 6:14 PM typo fix
    Saturday, July 25, 2020 6:13 PM