GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - icsharpcode/CodeConverter: Convert code from C# to VB.NET and vice versa using Roslyn

BranchesTags
Open more actions menu

Latest commit

 

History

3,850 Commits
3,850 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
CodeConv
CodeConv
 
 
CodeConverter
CodeConverter
 
 
Func
Func
 
 
Tests
Tests
 
 
Vsix
Vsix
 
 
hooks
hooks
 
 
web
web
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CodeConverter.sln.DotSettings
CodeConverter.sln.DotSettings
 
 
CodeConverter.slnLaunch
CodeConverter.slnLaunch
 
 
CodeConverter.slnx
CodeConverter.slnx
 
 
Directory.Build.props
Directory.Build.props
 
 
DotNetBuildable.slnf
DotNetBuildable.slnf
 
 
DotNetPublishable.slnf
DotNetPublishable.slnf
 
 
Get-LatestChangelog.ps1
Get-LatestChangelog.ps1
 
 
IncrementVersion.ps1
IncrementVersion.ps1
 
 
LICENSE
LICENSE
 
 
Linux.slnf
Linux.slnf
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
Update-NpmPackages.ps1
Update-NpmPackages.ps1
 
 
nuget.config
nuget.config
 
 

Repository files navigation

Code Converter

Build CodeConverter Install

Convert code from VB.NET to C# (and vice versa) using Roslyn - all free and open source:

  • Visual Studio extension
    • To install close VS and double-click the downloadeded .vsix file
  • Online snippet converter
  • Command line dotnet tool install ICSharpCode.CodeConverter.codeconv --global (still requires VS2026 18.0+ installed)
  • Nuget library (this underpins all other free converters you'll find online)

See wiki for advice on getting the best results, or the changelog for recent improvements.

Automated tests run against Windows 🪟 and Ubuntu Linux 🐧

Visual Studio Extension

Adds context menu items to convert projects/files between VB.NET and C#. See the wiki documentation for advice / help using it.

Download from Visual Studio Marketplace (Ideally use VS VS2026 18.0+)

  • Flexible: Convert a small selection, or a whole solution in one go, in either direction.
  • Accurate: Full project context (through Roslyn) is used to get the most accurate conversion.
  • Safe: Conversion runs entirely locally - your code doesn't leave your machine.
  • Completely free and open source GitHub project.
  • Integrated: Uses the Output window to show conversion progress / summary.
  • Actively developed: User feedback helps us continuously strive for a more accurate conversion.

Selected text conversion context menu

Contributing

Let us know what needs improving. If you want to get involved in writing the code yourself, even better! We've already had code contributions from several first time GitHub contributors, so don't be shy! See Contributing.md for more info.

The VB -> C# conversion quality is much higher than the C# -> VB conversion quality. The use cases differ considerably as does the supply/demand of improvements.

Use cases

Visual Basic .NET is slowly dying. It has support for some project types from .NET 5, but won't be getting new features according to the .NET Team Blog. Hence the main use case for:

  • VB->C#: moving whole projects
  • C#->VB: help incorporate snippets from stack overflow into existing VB codebase, or to help learning one language from the other

Other ways to use the converter

  • Latest CI build (potentially less stable):
    • See latest build
    • Uninstall current version, click on a build and download/install the VSIX file at the bottom of the page
  • Integrating the NuGet library
    • See CodeConversion.ConvertDocumentUnhandledAsync or CodeConversion.ConvertProjectUnhandled in the VSIX project.
    • See ConverterController for a more web-focused API.
  • Note: If converting net framework projects, the command line dropped support in version 10, but the visual studio extension still supports it

Building/running from source

  1. Ensure you have .NET Core SDK 10.0
  2. Open the solution in Visual Studio 2022+ (Community edition is sufficient)
  3. To run the website, set web as the startup project
  • You will need Node (LTS)
  1. To run the Visual Studio extension, set Vsix as the startup project
    • A new instance of Visual Studio will open with the extension installed

History

A spiritual successor of the code conversion within SharpDevelop and later part of Refactoring Essentials, the code converter was separated out to avoid difficulties with different Visual Studio and Roslyn versions.

More screenshots

About

Convert code from C# to VB.NET and vice versa using Roslyn

icsharpcode.github.io/CodeConverter/

Topics

c-sharpcode-converterconverteronline-snippet-converterroslynvb-netvisual-studio

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

917 stars

Watchers

39 watching

Forks

243 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.