Skip to content
GrahamTheCoder edited this page Jun 16, 2018 · 28 revisions

Before performing any conversion, it's recommended to ensure you have no uncommitted changes in your version control system. This will make it easy to see the result of the conversion, and discard any parts you don't want. Ensure your solution compiles for maximum conversion accuracy.

Using the Visual Studio extension

Converting whole project/solution

  • Right click the solution or project node to convert in the solution explorer and select "Convert to VB" or "Convert to C#".
  • The Output window will show progress - it may seem to pause for several minutes at times on large projects.
  • At the end of the process you'll be given the choice to automatically update any references (from non-converted projects and the solution) to reference the now converted projects. Cancelling the process at this point will leave all original files intact, and converted projects/files on disk to be manually inspected.
  • When the conversion finishes, the Output window will show a summary of the conversion's success, and one of the converted files will be opened as an example.

Converting a single file

  • Right click the .vb or .cs file to convert in the solution explorer and select "Convert to VB" or "Convert to C#".
  • The Output window will show progress - it may seem to pause for several minutes since related projects must be compiled.
  • When the conversion finishes, the Output window will show a summary of the conversion's success.
  • The converted file will be saved to disk adjacent to the original file (but with the appropriate converted file extension), and opened in a code window. It won't be part of any project or solution.

Converting a snippet

  • Open a .vb or .cs file containing code to be converted.
  • Highlight the relevant text.
  • Right click on the highlighted text and select "Convert to VB" or "Convert to C#".
  • The Output window will show progress - it may seem to pause for several minutes since related projects must be compiled.
  • When the conversion finishes, the Output window will show a summary of the conversion's success.
  • The converted snippet will be saved to disk adjacent to the original file (but with the appropriate converted file extension), and opened in a code window. It won't be part of any project or solution.

Selected text conversion context menu

Alternatively you can use the online snippet converter: https://codeconverter.icsharpcode.net/ However, it is less accurate due to the lack of project context.

Caveats

  • Files outside the solution directory will not be converted
Clone this wiki locally