Converting a VB.NET 2005 project to a C # 2008 project

Is there a tool to convert a VB.NET 2005 project into a C # 2008 project. I am trying to convert our project to VS 2008 and basically port all the vb.NET code to some C # 3.0 / 3.5 projects.

+4
source share
8 answers

You can check out SharpDevelop . This is an open source .NET development environment. SharpDevelop has built-in code conversion.

+2
source

I had a similar decision to make with the VB.net project. The solution was a compromise, I decided to work with dual VB and C #.

Updating VB.NET from 2005 to 2008 is an easy bit.

Added CSharp and VB folders in App_Code and

<codeSubDirectories> <add directoryName="CSharp" /> <add directoryName="VB" /> </codeSubDirectories> 

to the compilation section of web.config

According to Kev, this is not as straightforward as you might expect, and you will probably encounter unexpected problems that make working with bilingual support the best solution.

I know this does not directly answer the question, but this is an alternative approach

+4
source

Take a look at this.

http://www.developerfusion.com/tools/convert/vb-to-csharp/

Try using the term google to convert a vb.net project into a C # project, you will find several options there.

+1
source

There is a tool in CodeProject called GBVB (Goodbye VB) that claims to "flawlessly" convert VB.NET code to C # code. However, the author adds a number of caveats, such as problems with ambiguous code, optional parameters, etc.

Another approach might be to use Denis Bauer Reflector.FileDisassembler . Reflector .NET and unmount compiled assemblies back to C #.

Processing .aspx / .asmx pages and their code-encoded files is likely to be a special case, because you need to manually change the <%@ Page Codebehind="Default.aspx.cs" %> directives to point to the correct source files.

Automatic conversion of VB.NET to C # is not as straightforward as it seems at first glance. I was here earlier and abandoned a rather large project, there were many problems with specific extreme cases when the translation did not collect or create unexpected behavior at runtime. I decided to go for a two-language solution, where all the new code was written in C #, and the older VB.NET code was gradually ported over time.

+1
source

Hi this code is not

 public student () {} private string code; private string name; public string code() { set (code=Value); Get return code; } 
+1
source

Telerik has a converter that you can take a look at.

0
source

As others mentioned online conversion tools, I found www.carlosag.net to work best for my code. Perhaps b / c I am working with another third-party API, but it seems that many other online converters are simply mistaken if they fall into a string that they cannot convert.

0
source

SharpDevelop is not bad, but in my company we found that VBConversions provides a much more complete conversion. This is a commercial application, although, but for the time being saved over SharpDevelop, it was not easy for us.

As a specific example, we found that SharpDevelop incorrectly converted VB indices that use beveled brackets. It seemed that he could not distinguish between indices and method calls, so he did not convert indices into square brackets. VBC conversions converted them accurately. This is one of the things that cost him to buy for us.

It seems that Tangible Software has a very similar product to VBConversions, but I have no experience with it. Jon Skeet suggested it, so it should be very good.

0
source

Source: https://habr.com/ru/post/1286306/


All Articles