This page contains commonly asked questions and answers about C-Sharpener For VB.
If you have any additional questions, please contact us.
We are here to help!
-
C-Sharpener For VB can automatically convert VB to C# (or as some developers like
to spell it VB 2 CSharp
). It is a Visual
Studio .NET addin and converts all VB.NET project related files including the project
file itself.
-
You can convert most project types from VB to C# with C-Sharpener For VB:
- Windows Application
- Class Library
- Windows Control Library
- ASP.NET Web Application
- ASP.NET Web Service
- Web Control Library
- Console Application
- Windows Service
C-Sharpener For VB does not support Smart Device Applications.
-
You need Visual Studio .NET 2003, 2005 or 2008 (Standard, Professional, or Team edition)
installed on your computer to run C-Sharpener For VB because it is a Visual Studio
.NET Addin. C-Sharpener For VB does not support Visual Studio .Net 2005 or 2008 Express
edition because the Express edition does not support Visual Studio .NET Addins.
-
Please see why C-Sharpener For VB is the best choice.
-
For the record, we see value in both the VB.NET and C# languages. However, if C#
is your preferred language, you want to convince others to switch from VB. You can
use the reasons below to convince your managers or co-workers.
Here are some reasons that you can use to convince your managers:
- Your code quality will improve because C# catches potential errors (example: variable
use allowed before initialization and dead code) that are permitted in VB.NET.
- Your developers will be more productive because they will work in a language that
they like.
- If your project is a mix of VB.NET and C# code, your developers will be more productive
because they wont have to switch between languages.
- C# is more portable than VB.NET. It is closer to Java which makes it easier to port
code to Java later. It also can run on other operating systems (including Linux)
by using the Mono and DotGNU open source projects.
- C# has been submitted as a standard language (ECMA) which makes its syntax more
stable. Microsoft could make drastic changes to VB.NET at any time.
- Microsoft does all of its internal .NET development in C#. Even MS thinks C# is
the better language.
- C# is better because it has the ability to write unsafe code for better interoperability.
Here are some reasons that you can use to convince your fellow developers:
- Developers who program primarily in C# earn 26 percent more than those who develop
primarily in Visual Basic .NET. (Source: 2003 Salary Survey: How Do Your Earnings
Stack Up?, Visual Studio Magazine, June 2003)
- C# just looks more elegant because it was consistently designed. VB.NET was evolved
over many years and has inconsistencies.
- C# is closer to Java which means it is easier for you to move to or from Java. This
is good for your career.
- C# is perceived as a real language where VB.NET is still perceived as a toy language.
- Microsoft does all of its internal .NET development in C#. Even MS thinks C# is
the better language.
- C# has the ability to write "unsafe" code for better interoperability.
-
The percentage of the project that will be converted is typically more than 99%.
However, the percentage can vary greatly depending on the structure of your code.
For instance, if Option Strict is On then it is significantly easier to convert
your code because C# is more type strict. Please see
Limitations and Workarounds (PDF file) for more details. You may also want
to look at some sample converted projects.
-
Please see Limitations and Workarounds
(PDF file) for more details. You may also want to look at some
sample converted projects.
-
C-Sharpener For VB does not convert vbscript. However, it does convert all Visual
Basic .NET code in code-behind (*.vb) pages.
-
C-Sharpener For VB only converts from VB.NET to C#. If you want to convert Visual
Basic 6 or earlier, we recommend that you first upgrade from VB6 to VB.NET with
Microsoft's free VB to VB.NET Upgrade Wizard. After that,
switch to C-Sharpener For VB to complete the VB.NET to C# conversion. This two step
process seems to lead to the most reliable results.
-
We recommend that you try the online conversion service provide by NetEdge Software:
-
Please see Tutorial & Screens for screenshots on
how to use C-Sharpener For VB.
-
Assuming that you have successfully installed C-Sharpener For VB, the menu option
should automatically appear. If it doesn't appear, then try the following:
- Launch Visual Studio .Net.
- Click on the Tools menu option.
- Click on the Add-in Manager menu option. You should see the following screen:

If you don't see C-Sharpener For VB as an option, please try installing C-Sharpener
For VB again.
- Turn on the checkbox to the left of C-Sharpener For VB and click the OK
button. The menu option should now appear. If the menu doesn't appear after you
turn on the checkbox, then please try the following:
- Click on the Tools – Customize menu option.
- Click on the Command tab.
- Click on the Addins Category.
- If you see C-Sharpener For VB in the Commands list, then drag it to the
toolbar or menu.
If the C-Sharpener For VB menu option still doesn't appear or you don't see the
C-Sharpener For VB option in the Add-in Manager , then please try the following:
- Close all instances of Visual Studio .NET.
- Launch a command window that has the Visual Studio .NET path and other environment
variables set up. You can normally do this by clicking Start menu, Programs
menu, Microsoft Visual Studio .NET menu, Visual Studio .NET Tools
menu and then select Visual Studio .NET Command Prompt. There is a similar
menu option for Visual Studio 2005.
- Once you see the command prompt type one of the following and press the enter key:
devenv /setup (for Visual Studio .NET 2003)
or
devenv /resetaddin * (for Visual Studio .NET 2005 or 2008)
For example, it should look like the following for Visual Studio .NET 2003 when
you are through:

If you have multiple versions of Visual Studio .NET installed on your machine, please
make absolutely certain that you are running the right version of devenv.
- Launch Visual Studio .NET and you should see the C-Sharpener For VB menu
option.
If that still doesn't work, then please contact us so
that we can help.
-
Please see What percentage of my Visual Basic .NET project will
be converted?
-
C-Sharpener For VB is really a full parser that emits C# instead of MS Intermediate
Language. It does full syntactic and semantic analysis including a full symbol tree
of all symbols in the code and referenced assemblies. Some conversion problems can
only be solved with this level of technology. For instance, if you may have the
following line of VB code to convert:
val = a(2) 'method or array?
How can you tell whether "a(2)" represents an index into an array or a method call?
The answer is you can't unless you resove "a" and know that it is a method or an
array. Solving this problem requires full symbol resolution. This is important when
translating to C# because the syntax is different for each situation:
val = a(2); // method
val = a[2]; // array
There are significant differences between the syntax of VB.NET and C#. If you are
curious to learn more, we found the following book extremely useful:
-
We offer a 15 day, 100% money-back guarantee. If for any reason you are unhappy
with our product, just send an email (csharpener_sales@elegancetech.com)
with your original invoice attached and a brief explanation of why you are returning
the product. Also, you must remove C-Sharpener For VB from all computers and destroy
any code that you translated with C-Sharpener For VB. We will provide you a prompt
refund.
-
If you purchase C-Sharpener For VB, we will give you ALL future releases for free!
-
Version 1.2 is a minor version upgrade that includes the following:
- There is a new option to automatically convert VB.Net methods with optional parameters
to C# overloaded methods.
- Improved handling of hex number conversion.
- Improved handling of web references so that a web reference with a non-default name
converts correctly.
- Improved handling of strong named COM objects so that conversion completes successfully.
- Fixed bug that prevents conversion if there is a "missing" project in the Solution.
- Fixed stack overflow exception when exceptionally long strings are converted.
- Fixed internal remoting error that caused conversion of some large files and projects
to fail.
- Reduced the amount of memory required for conversion of large projects.
-
Version 1.3 is a minor version upgrade that includes the following:
- Added support for converting on the network. You can now enter project paths such
as "\\server1\testprojects".
- Added a new command-line interface so that conversions can easily be repeated.
- Improved automatic casting so that there is less manual cleanup required.
- Improved "ref" and "out" parameter processing so that a temporary variable is created
if necessary.
- Fixed problem that prevented some assemblies from loading during conversion. This
often caused a project to be "successfully" converted, but no lines of code were
added to the project.
- Fixed problem with parsing ">>=" and "<<=" expressions.
- Fixed internal remoting error that caused conversion of some large files and projects
to fail.
- Fixed problem with processing the Thread class.
-
Version 1.4 is a minor version upgrade that includes the following:
- Added option to automatically convert non-default properties to with parameters
to get and set methods.
- Added support to convert On Error Goto to Try/Catch statement.
- Added temp variables for calls to methods that have properties as parameters when
the method parameters are ref or out.
- Added return statements for code paths that don't return a value.
- Added fully qualified names to method calls when necessary.
- Added automatic adjustment of CLSCompliant attribute to false.
- Improved default initialization when multiple variables are declared in one statement.
- Improved handling of very long string concatenation expressions.
- Fixed assignment of default values to value types.
- Fixed type conversion when assigning to a constant declaration.
- Fixed use of class name with static methods and properties.
- Fixed use of ref and out in indexers.
- Fixed array conversion.
- Fixed casting issue for overloaded methods.
- Fixed casting issue for arguments in method invocations that a ParamArray parameter.
- Fixed handling of thread launching.
- Fixed unnecessary out arguments.
-
Version 2.0 is a major version upgrade that includes the following:
- Added support for Visual Studio .Net 2005 and all new language features.
- Added option for new line before opening curly brace ('{') (Professional edition
only).
- Added option to eliminate dependencies on VisualBasic namespace (Professional edition
only).
- Added option to comment out unused private fields, methods, and properties (Professional
edition only).
- Added Conversion Issue Report that describes all the conversion warnings and errors
(Professional edition only).
- Added support for better conversion of DLLImport.
- Improved handling of VB Finalize method.
- Improved handling of ByVal.
- Fixed conversion failed if output directory was not "bin".
- Fixed error with converting properties with parameters and return array type.
-
Version 2.1 is a minor version upgrade that includes the following:
- Compiled and tested with the final release release versions of Visual Studio 2005
and the .Net Framework 2.0.
- Added conversion of Constants.vbCrlf and Constants.vbNullString.
- Fixed error in parsing properties of generic type that have an array parameter (Visual
Studio 2005 only).
- Fixed error in converting using statement with My object (Visual Studio 2005 only).
- Fixed error in converting a DLL call.
- Fixed error in parsing methods returning a generic type (Visual Studio 2005 only).
- Fixed error in converting ForEach loop.
- Fixed error in converting equivalent of IIF and Left().
- Fixed unrecoverable error while converting in Visual Studio 2005.
-
Version 2.2 is a minor version upgrade that includes the following:
- Increased the trial limit to 1000 lines of code.
- Improved handling of manifest files.
- Improved installer for Visual Studio 2005 when Visual Studio 2003 is not installed
(Visual Studio 2005 only).
- Improved handling of long project paths.
- Fixed several errors in parsing when multiple VB statements are on the same line
separated by ":".
- Fixed error in converting the "<>" operator.
- Fixed error in converting local variables in a Case statement.
- Fixed error in parsing Catch blocks.
- Fixed error in updating language attributes in .aspx files (Visual Studio 2005 only).
- Fixed error in converting For loops that decrement.
- Fixed error in converting Try statements that have comments.
- Fixed error in converting inconsistent accessors in partial classes (Visual Studio
2005 only).
-
Version 2.3 is a minor version upgrade that includes the following:
- Improved support for Microsoft Vista.
- Improved code generation by removing unreachable code.
- Added support Web Application project (Visual Studio 2005 only).
- Added support for LBound and UBound VB translation.
- Fixed error in casting.
- Fixed error in handling of the split method.
- Fixed exception if exe is present in the Solution.
- Fixed XML exception.
- Fixed error with two constructors being created for forms.
- Fixed error with Page Load events in web projects (Visual Studio 2005 only).
- Fixed error related to misplaced closing brace.
- Fixed error with DateTime.
-
Version 3.0 is a major version upgrade that supports Visual Studio 2008.