Welcome

Welcome to the VBConversions VB.Net to C# Converter!

VBConversions has the most accurate VB.Net to C# Converter in the market and has won the coveted Visual Studio Magazine Readers Choice Award as well as several other industry awards.

The VBConversions VB.Net to C# Converter supports the latest features of VB.Net as well as every project type and Visual Studio version (2003, 2005, 2008, and 2010). It is used by many of the Fortune 500 companies to convert their VB.Net code to C#. See what it can do for you!

Some of your fellow customers are:

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation


Summary of Features

Summary of Features

VBConversions supports converting all versions of Visual Basic.Net to C#

    • Visual Basic 2003
    • Visual Basic 2005
    • Visual Basic 2008
    • Visual Basic 2010

All VB.Net project types are supported:

    • Windows forms projects
    • Web projects (requires Web Application Projects)
    • Compact Framework projects
    • WPF projects
    • Console Application projects
    • Class Library projects

Support for the tough conversion issues:

    • Complex Case statements (not allowed in C#) , including ranges, lists, and non-integer case variables.
    • Parameterized properties
    • Correct casing of identifiers (VB is case insensitive, C# case sensitive)
    • Custom event handling
    • On Error Gotos are replaced with Try-Catch blocks in many cases
    • ReDim's
    • Native API calls
    • Automatic commenting out of dead code (dead code isn't allowed in C#).
    • Auto initializing variables if necessary.
    • Automatically determining the type of untyped constants
    • Automatic correction of most C# compiler errors in the generated code (yes, really).
    • The list goes on and on...

Support for all the latest VB.Net features:

    • LINQ
    • In line XML, including "code hole" support
    • Object initializers
    • Extension methods
    • Lambda expressions
    • Nullable data types
    • Implicit types
    • Anonymous types
    • etc.

Multiple project conversion support.

    • Large groups of projects can be converted at once
    • VBConversions uses this feature to test releases. Current testbed is more than 6,000 VB.Net projects which are converted to C# with one click.
    • Click here for more details on converting multiple projects.

Customization.

Your VB.Net projects are unique and may require custom handling during conversion. There are literally dozens of conversion options you can configure to meet your specific needs:

    • Specify which VB namespace functions (Mid, Right, Left, IIF, etc) you want converted to their .Net equivalents.
    • Choose to have unreachable code commented out (to prevent C# compiler errors)
    • Decide how ref and out arguments are converted
    • Specify how With statements are to be converted
    • Choose if X=X+1 and X +=1 are to be converted to X++
    • Plus many more options. Click here for more details on setting conversion options.

Comprehensive reporting.

You're not left wondering what happened to your code. You will get comprehensive reports on:

    • Potential problem areas of your code (very important to pay attention to)
    • Conversion notes - interesting things which happened during conversion
    • Any C# compiler errors which could not automatically be fixed by the converter
    • Syncronized side by side VB.Net and C# code listings

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Full featured Documentation generator


FAQ

Frequently Asked Questions

What versions of Visual Studio are supported?

All versions of Visual Studio are supported: 2003, 2005, 2008, 2010.

I'm a registered user. Can I use the latest version?

Yes! Registered users get free upgrades for life. Simply download and install the latest version. It will install side by side with the old version and not impact it at all. It will recognize that the old version is fully registered and also install as a registered version with no limitations.

Is my VB.Net code guaranteed to translate to C# perfectly?

Due to Visual Basic's inherent ambiguities (which VBConversions goes the extra mile to resolve), no automated converter can always translate VB.Net to C# perfectly. However, many programs do convert without errors. The 101 sample projects from Microsoft convert and compile without errors, as do hundreds of other publicly available sample VB.Net programs. Other sample programs do have minor problems converting, which are usually easily fixed manually. Your individual results will vary, depending on quality and size of your VB.Net projects.

What types of VB.Net projects can be converted?

All project types can be converted: Windows Forms, WPF, Console, Windows Service, Web Forms, Web Control, Windows Control, Class Library, and Compact Framework projects.

How Do I Convert Web Projects?

You can convert web sites by making them Web Application Projects. Web Application Projects is an add on to Visual Studio 2005 (but built in to Visual Studio 2008 and above). You can download the Visual Studio 2005 Web Application Project add-in here.

Can I Convert Visual Basic 6 Projects?

Not directly, but Visual Basic 6 projects can be upgraded with the VB6 Upgrade Wizard in Visual Studio.Net and then run through the converter. Make sure the upgraded project compiles successfully in VB.Net before attempting to convert it to C#.

What's the Difference Between the Trial Version and the Full Version?

The Trial Version expires in 15 days and is limited to 1100 lines of code.

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites


How to Convert a VB.Net Project to C#

How to Convert a VB.Net Project to C#

There are four steps to converting a Visual Basic.Net project to C#:

1) Check for potential conversion problems and correct

2) Convert your VB.Net project to C#

3) Review conversion notes and fix C# compiler errors

4) Fix any runtime issues

Check for Potential Conversion Problems

The first step in a conversion is to check for potential conversion problems. From the main screen, pick "Convert a VB.Net Project to C#". Before the conversion actually takes place, your project will be automatically checked for possible conversion issues.

Next, you will be prompted to pick a VB.Net project to convert. Choose your project and press "Open".

Your project will be first be checked for potential problems before converting and you will be shown a screen similar to the one below:

Press "View Problems" to see the potential problems (similar to below). You can double click to see the details of a potential problem or print detailed reports from the Reports menu.

It is highly recommended to fix all Critical and High severity potential problems before attempting a conversion. Most Medium severity potential problems are handled successfully by the converter, but can sometimes be a source of problems. If correcting Medium severity errors is too time consuming, you can attempt a conversion and see if any of the potential issues actually cause problems.

When you are done fixing potential conversion problems and are ready to convert, repeat the above steps but press "Convert Anyway" when potential problems are displayed.

Convert Project to C#

When you are done fixing potential conversion problems, you can then convert your VB.Net project to C#. From the main screen, choose "Convert a VB.Net Project to C#".

Next, you will be prompted to pick a VB.Net project to convert. Choose your project and press "Open".

Your project will be first be checked for potential problems before converting and you will be shown a screen similar to the one below:

Press "Convert Anyway" to convert to C#. A screen will be shown which lists a summary of the conversion statistics. Press "View Conversion Results" to see the details of the conversion.

From the detailed conversion results screen, you can view the results by file, view potential problems, conversion notes, and C# compiler errors.

Double clicking on a file will show the file conversion details and a side by side code listing.

Conversion notes can also be reviewed. These are interesting things which happened to your code during the conversion to C#. Pay particular attention to high severity issues as they can frequently cause C# compiler errors. Generally, you should fix high severity conversion notes in your VB.Net project (not the C# project) and reconvert.

You can double-clicking a conversion note, potential problem or compiler error to see its details.

Press "View Problems" to see the potential problems (similar to below). You can double click to see the details of a potential problem or print

For large projects, it can take a long time to convert and there may be intermittent pauses. Let it run to completion. For converting large projects, it should be run on a relatively powerful computer.

Once the project is done converting, the number of compiler errors and conversion notes will be displayed, similar to below:

Review Conversion Notes and Fix C# Compiler Errors

After your project is converted to C#, you should:

1) Review conversion notes. Pay particular attention to high severity issues and fix in your VB.Net project and reconvert.

2) Fix C# compiler errors. It is counter-intuitive but extremely important to try to fix any C# compiler errors by making changes in your VB.Net code and reconverting.

Note - Fixing C# compiler by making necessary changes in your VB.Net program (not the converted C# program) is very important. The converter achieves its high accuracy by successive C# compiles and automatic error fixing of the converted code. A severe C# compiler error can stop this process prematurely and prevent the automatic fixing of compiler errors in totally unrelated areas of code. It is highly recommended that you hold off as long as possible from changing the generated C# code.

Fix Runtime Problems

Once your project compiles successfully, the runtime behavior should be thoroughly tested.

One potential issue to check is relative path names. For example, if your initial VB.Net code was:

Dim sr As New System.IO.StreamReader("..\test.txt")

Your converted C# code is now in a different directory (initially in the CS directory under your VB.Net project directory) and the path may be invalid or the file not found at the new relative location. You should change the code to use a different relative path name or explicitly point to the appropriate directory.

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Easily create Help documents


How to Convert Multiple VB.Net Projects to C#

How to Convert Multiple VB.Net Projects to C#

You can convert multiple projects at once using the VBConversions VB.Net to C# Converter. You simply create a project list, add projects to the list, then convert the whole list of projects at once. You may also run over a dozen printable reports to help you manage converting multiple projects. VBConversions itself uses a project list of over 3000 programs to test each release.

To convert multiple projects, pick "Convert Multiple VB.Net Projects to C#" from the main menu:

Type in the name of your new project list to create and press Ok. The next time you enter this screen, your new project list will automatically appear in the list of Existing Project Lists.

Next you can add projects to you project list. You may add them individually, or add all projects in a folder and its subfolders. When done, you can convert all the projects at once to C#. The are also over a dozen printable reports to help you manage converting multiple projects.

When "Convert All" or "Convert Selected" is pressed, the following screen is displayed showing the progress of the conversions. When done, close this window and you will be taken back to your project list where you can fix problems with individual projects or run summary reports on the whole list.

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Full featured Documentation generator


Conversion Options

Conversion Options

Your project is unique, and you can configure dozens of conversion options to suit the needs of your particular application. To see the conversion options available, choose "Change Conversion Options" from the main screen.

The General conversion options control program flow and miscellaneous conversion options. Be careful when changing the default options in the "Ref and Out Arguments" and "Misc" sections, as this can have a negative effect on conversion accuracy.

VB Namespace options allow you to specify which VB specific functions you want converted to their .Net equivalents. In general, you should leave all these options checked, unless a particular item is causing problems in your conversion.

The "With" options control how VB With clauses are converted. They can be converted two ways:

1) The With clause can be repeated for each reference in the with block (the first example below), or

2) Assign the With clause to a temporary variable and reference the temporary variable in the with block. This is essential if the With clause contains side effects (such as adding a record to a database as in the example below).

By default, VBConversions will use temporary variables to convert With clauses if a method is being called in the With clause or if it can't determine if a method is being called.

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation


Contacting VBConversions

You may contact VBConversions for support at admin@vbconversions.net

To purchase the VBConversions VB.Net to C# Converter click here

Copyright © 2009, VBConversions

Created with the Freeware Edition of HelpNDoc: Easily create Web Help sites