The VB code and the converted C# code both compile but return different results. Unfortunately another variable with the different case is also accessible. Here, the VB coder has used different case for a parameter and for referencing the parameter in the body of the method. Consider the following, admittedly ugly and contrived, code: There were problems with inheritance, and even subtle bugs. The converter was unable to fix case-sensitivity issues, and introduced some of its own ( Imports System.Text became using System.text and threw an error). Visual Studio does a good job of making your VB code mostly consistent with regard to case, but that is not a fix. Moving from a case-insensitive language to a case-sensitive language is a problem. It is probably a good idea to remove this dependency, but it is not a problem if you want the quickest possible port. You can often simplify the code and remove the reference but of course you might introduce a bug with careless typing. Less good is that statements using this assembly tend to be more convoluted, making maintenance harder. The generated project failed to set a reference to this assembly, generating lots of errors about unknown objects called Information, Strings and so on. This namespace provides handy VB features like DateDiff, which calculates the difference between two dates. The tool makes use of the Microsoft.VisualBasic namespace to simplify the conversion. In fact, I was surprised at how many things went wrong. There were thousands of errors which will take several days of effort to fix, and the generated code is not as elegant as code written for C#.
Based on my experience, I advise caution – though acknowledging that the converter does an amazing job, and is free and open source. I tried it, on a moderately-size VB DLL project. Still, if converting a project is just a right-click in Visual Studio, you might as well do it, right?
Even Visual Basic 6.0 applications still run, though you might find it convenient to keep an old version of Windows running for the IDE. Note though that Visual Basic is still under active development and history suggests that your Windows VB.NET project will continue running almost forever (in IT terms that is). Microsoft has stated that “with regard to the cloud and mobile, development beyond Visual Studio on Windows and for non-Windows platforms, and bleeding edge technologies we are leading with C#.” The Xamarin framework can use VB to some extent, but it is primarily a C# framework.NET Core was developed first for C#. Why would you do this though? There are several reasons, the foremost of which is cross-platform support. You can also find this on the Visual Studio marketplace. The SharpDevelop team has a nice tool for this, CodeConverter, which promises to “Convert code from C# to VB.NET and vice versa using Roslyn”.
Some years later, I wondered how easy it is to convert a VB project to C# using Roslyn. NET compiler platform, one of the features described was the ability to take some Visual Basic code and “paste as C#”, or vice versa. When Microsoft first started talking about Roslyn, the.