Refactoring Essentials now with a Roslyn Code Converter

The Discussion

  • User profile image
    alashcraft

    We're inching closer and closer to that fateful day... the day I can open/edit/save a *.vb file in the C# editor in Visual Studio.

    ...or vice-versa if that's your thing.  ;)

  • User profile image
    Kelps

    Looking forward for the VB to C# converter. I need this to convince my bosses to change our current code base to C#. I'll take a look at the source code as soon as I find the time to see if I can contribute in the effort to code that converter....

  • User profile image
    KeyboardG

    This is a great project to prove out the Roslyn tools. I just can't imagine a use case in the business world.

  • User profile image
    tutor

    @Kelps: FYI - http://www.icsharpcode.net/OpenSource/SD/Download/  v4.4 has a convert VB PROJECT to C#  (98% accurate).

  • User profile image
    Masoud

    Hello,

    it seems that your converter cannot correctly convert the following code to a true VB.NET code. In C# we can explicitly make the set function private but see the result of pasting the following code. it's wrong.

    public class Test {
    public string Name {get; private set;}
    }

    The wrong conversion is : ( the following is wrong because the name is now public and any body can set the value of it even outside of the Test class. but the c# code does not allow this property to be set outside of the Test class).

    Public Class Test
    Public Property Name As String
    End Class

  • User profile image
    Masoud

    The correct VB.NET code of the my previous comment must be :

    Public Class Test
    Public Property Name() As String
    Get
    Return m_Name
    End Get
    Private Set
    m_Name = Value
    End Set
    End Property
    Private m_Name As String
    End Class

  • User profile image
    gduncan411

    @Masoud: Thanks for checking it out. The best way to raise this with the team is to post the issue in the repo here, https://github.com/icsharpcode/RefactoringEssentials/issues

  • User profile image
    AL17

    Excellent,

    I was testing the c #  to visual basic (V.S) converter and I can say that it is excellent.

    A step in the right direction. Simply, powerful and useful!

    Thank you

    ;)

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.