Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Converting vb.net to c#

Converting vb.net to c#

Scheduled Pinned Locked Moved The Lounge
csharpquestionvisual-studiocom
33 Posts 22 Posters 23 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Christopher Duncan

    Thanks, man. If I can't find a batch oriented critter I'll check it out.

    Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

    L Offline
    L Offline
    linuxjr
    wrote on last edited by
    #13

    I haven't tried this one yet Batch Code Converter[^] but I have used the single file vb to c# converter Single File Code Converter[^] and it works pretty decently. I hope this helps some.

    1 Reply Last reply
    0
    • C Christopher Duncan

      I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

      Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

      R Offline
      R Offline
      RCoate
      wrote on last edited by
      #14

      I used developer fusion's online tool to convert a VB.Net website to c#. Free, but does not like "handles" clauses. http://www.developerfusion.com/tools/convert/vb-to-csharp/[^] Everything else seemed to be ok.

      1 Reply Last reply
      0
      • C Christopher Duncan

        I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

        Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

        C Offline
        C Offline
        Chris Fulstow
        wrote on last edited by
        #15

        I highly recommend Instant C#. It's not free but worth every penny, it's very accurate and we just used it to convert 10,000s of lines of VB.NET to C#. http://tangiblesoftwaresolutions.com/Product_Details/Instant_CSharp.html[^]

        1 Reply Last reply
        0
        • C Christopher Duncan

          I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

          Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #16

          SharpDevelop has a converter feature built in. Appears to just call this webservice for the actual conversion... so try before you download.

          D 1 Reply Last reply
          0
          • C Christopher Duncan

            I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

            Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

            D Offline
            D Offline
            davidkhale
            wrote on last edited by
            #17

            I have had success with the CSharpener product, but I don't think it was free. Plus you must fix numerous syntax errors after the conversion process.

            1 Reply Last reply
            0
            • C Christopher Duncan

              I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

              Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #18

              You can try the below online tools http://www.developerfusion.com/tools/convert/vb-to-csharp/[^] and http://www.carlosag.net/Tools/CodeTranslator/[^]

              Regards Aman Bhullar www.arlivesupport.com[^]

              1 Reply Last reply
              0
              • C Christopher Duncan

                I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                G Offline
                G Offline
                Guy Harwood
                wrote on last edited by
                #19

                http://converter.telerik.com has a bulk file converter tool too. i have used that extensively over the last few years on various projects and works well. just the indexers that you have to do manually, and the last time i used it it didnt like LINQ

                ---Guy H ;-)---

                C H 2 Replies Last reply
                0
                • C Christopher Duncan

                  I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                  Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                  S Offline
                  S Offline
                  Sinisa Hajnal
                  wrote on last edited by
                  #20

                  Try with http://download.cnet.com/Convert-NET/3000-2096_4-10696573.html[^] It occasionaly hickups, but all in all it is dependable.

                  1 Reply Last reply
                  0
                  • C Christopher Duncan

                    I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                    Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                    A Offline
                    A Offline
                    Argyle4Ever
                    wrote on last edited by
                    #21

                    How about rewriting it from the start in C#? Im not really in favour of these conversion tools as all they do is a straight port and can add a bit of baggage on the way. if you rewrite it you can optimise it more for the new language, and possibly increase performance. personally, if you just want to translate from vb to c# without rewriting or adding new features then I would question the need of doing this task in the first place. JC

                    View my CodePlex Projects here -> http://www.codeplex.com/site/users/view/john\_crocker

                    K 1 Reply Last reply
                    0
                    • C Christopher Duncan

                      I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                      Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                      F Offline
                      F Offline
                      Finbar
                      wrote on last edited by
                      #22

                      Artisoft have a good product.

                      1 Reply Last reply
                      0
                      • G Guy Harwood

                        http://converter.telerik.com has a bulk file converter tool too. i have used that extensively over the last few years on various projects and works well. just the indexers that you have to do manually, and the last time i used it it didnt like LINQ

                        ---Guy H ;-)---

                        C Offline
                        C Offline
                        Carl Reid
                        wrote on last edited by
                        #23

                        I can vouch for the Telerik tool. This is the most effective (free) converter I have used. Still don't understand why it can't work out that C# uses square brackets for indexers and VB.NET uses normal brackets. I always have to fix these manually. Also watch out for array declaration. In C# you declare an array according to the number of items in it, in VB.NET you specify the upper boundary. This can cause difficult to find run-time errors if you don't look out for it.

                        D 1 Reply Last reply
                        0
                        • A Argyle4Ever

                          How about rewriting it from the start in C#? Im not really in favour of these conversion tools as all they do is a straight port and can add a bit of baggage on the way. if you rewrite it you can optimise it more for the new language, and possibly increase performance. personally, if you just want to translate from vb to c# without rewriting or adding new features then I would question the need of doing this task in the first place. JC

                          View my CodePlex Projects here -> http://www.codeplex.com/site/users/view/john\_crocker

                          K Offline
                          K Offline
                          Kevin McFarlane
                          wrote on last edited by
                          #24

                          John_Crocker wrote:

                          personally, if you just want to translate from vb to c# without rewriting or adding new features then I would question the need of doing this task in the first place

                          So would I. IMO all .NET developers should be able to read code reasonably well (and look up the little bits they don't understand) in both C# and VB regardless of which they code in.

                          Kevin

                          1 Reply Last reply
                          0
                          • G Guy Harwood

                            http://converter.telerik.com has a bulk file converter tool too. i have used that extensively over the last few years on various projects and works well. just the indexers that you have to do manually, and the last time i used it it didnt like LINQ

                            ---Guy H ;-)---

                            H Offline
                            H Offline
                            hjpc
                            wrote on last edited by
                            #25

                            maybe this can help ? [^]

                            H 1 Reply Last reply
                            0
                            • H hjpc

                              maybe this can help ? [^]

                              H Offline
                              H Offline
                              hjpc
                              wrote on last edited by
                              #26

                              i meant [^] this helped me a lot in converting from a Outlook addin in VB to C# addin cheers, biozes

                              1 Reply Last reply
                              0
                              • H Henry Minute

                                Sharp Develop can do this. Only one file at a time though and it sometimes makes small errors. Hey it's free though. :)

                                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                D Offline
                                D Offline
                                Daniel Grunwald
                                wrote on last edited by
                                #27

                                SharpDevelop can convert whole projects in one step. And yes, while it does make errors; I think it does pretty good job nowadays. For example, SharpDevelop 3.1 RC2 correctly converts the different rounding semantics when casting floating-point values to integers (VB rounds, C# truncates). Most other converters just translate "CInt(x)" to "(int)x", introducing a subtle bug in the converted program if x was a floating-point value.

                                H 1 Reply Last reply
                                0
                                • S Shog9 0

                                  SharpDevelop has a converter feature built in. Appears to just call this webservice for the actual conversion... so try before you download.

                                  D Offline
                                  D Offline
                                  Daniel Grunwald
                                  wrote on last edited by
                                  #28

                                  The converter built into SharpDevelop does not call any webservice. SharpDevelop and that webservice just use the same open-source libraries to do the conversion (ICSharpCode.NRefactory and ICSharpCode.SharpDevelop.Dom).

                                  1 Reply Last reply
                                  0
                                  • D Daniel Grunwald

                                    SharpDevelop can convert whole projects in one step. And yes, while it does make errors; I think it does pretty good job nowadays. For example, SharpDevelop 3.1 RC2 correctly converts the different rounding semantics when casting floating-point values to integers (VB rounds, C# truncates). Most other converters just translate "CInt(x)" to "(int)x", introducing a subtle bug in the converted program if x was a floating-point value.

                                    H Offline
                                    H Offline
                                    Henry Minute
                                    wrote on last edited by
                                    #29

                                    Daniel Grunwald wrote:

                                    SharpDevelop can convert whole projects in one step.

                                    Thanks, I wasn't aware of that. I'll have to look at the latest version.

                                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                                    1 Reply Last reply
                                    0
                                    • C Carl Reid

                                      I can vouch for the Telerik tool. This is the most effective (free) converter I have used. Still don't understand why it can't work out that C# uses square brackets for indexers and VB.NET uses normal brackets. I always have to fix these manually. Also watch out for array declaration. In C# you declare an array according to the number of items in it, in VB.NET you specify the upper boundary. This can cause difficult to find run-time errors if you don't look out for it.

                                      D Offline
                                      D Offline
                                      Daniel Grunwald
                                      wrote on last edited by
                                      #30

                                      To convert VB normal brackets to square brackets, the converter needs to know if the expression is referring to a method or an array. Of the free code converters I know, only SharpDevelop uses type information. Note that type information isn't only necessary to translate array access correctly - it also is required to distinguish integer divisions from other kinds of divisions; the different sorts of cast operators, etc. Converters which don't use a type system will introduce subtle bugs in the translated code because the two languages work differently (e.g. int a=3, b=2; int c=a/b; results in c=1 in C#, but c=2 in VB. The converter must detect that the division is an integer division and use the VB integer divide operator '\') By the way, I highly recommend downloading SharpDevelop to do the conversion. The online converter[^] cannot look at your project's references, so it cannot use the full type system.

                                      1 Reply Last reply
                                      0
                                      • C Christopher Duncan

                                        I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                                        Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                                        S Offline
                                        S Offline
                                        Steve Naidamast
                                        wrote on last edited by
                                        #31

                                        Since you are planning on "down grading" your code to C# [:-) I program in both languages fluently] here is the best online free tool I have found... http://www.developerfusion.com/tools/ Beyond this most such tools cost around $200.00 or so... VB.NET!!! Still The One!!!

                                        Steve Naidamast Black Falcon Software, Inc. blackfalconsoftware@ix.netcom.com

                                        1 Reply Last reply
                                        0
                                        • C Christopher Duncan

                                          I don't think this is a programming question as I'm looking for a tool, but I'm donning the asbestos suit just to be on the safe side... :) I have a VS 2005 project that's written in vb.net, and I'd like to find a tool (preferably free) that I can point at it to convert the codebehind to c# simply because I'm more familiar with the syntax. Anyone have recommendations / experiences to share? Thanks!

                                          Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                                          S Offline
                                          S Offline
                                          swissfritz
                                          wrote on last edited by
                                          #32

                                          The Telerik Converter is quite useless. I Tested it with 3 perfectly well running .vb files, leaving out the handles-clause and I always got the same type of error: CONVERSION ERROR ... invalid StructMembDecl.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups