C# for Visual Studio Code (powered by OmniSharp)
Master |
Release |
 |
 |

Welcome to the C# extension for Visual Studio Code! This extension provides the following features inside VS Code:
- Lightweight development tools for .NET Core.
- Great C# editing support, including Syntax Highlighting, IntelliSense, Go to Definition, Find All References, etc.
- Debugging support for .NET Core (CoreCLR). NOTE: Mono debugging is not supported. Desktop CLR debugging has limited support.
- Support for project.json and csproj projects on Windows, macOS and Linux.
The C# extension is powered by OmniSharp.
Get Started Writing C# in VS Code
Note about using .NET Core 3.1.40x SDKs
The .NET 3.1.40x SDKs require version 16.7 of MSBuild.
For MacOS and Linux users who have Mono installed, this means you will need to set omnisharp.useGlobalMono
to never
until a version of Mono ships with MSBuild 16.7.
Note about using .NET 5 SDKs
The .NET 5 SDK requires version 16.8 of MSBuild.
For Windows users who have Visual Studio installed, this means you will need to be on the latest Visual Studio 16.8 Preview.
For MacOS and Linux users who have Mono installed, this means you will need to set omnisharp.useGlobalMono
to never
until a version of Mono ships with MSBuild 16.8.
What's new in 1.23.8
- Updated Debugger support (PR: #4281)
- Updated the version of .NET that the debugger uses for running its own C# code to .NET 5
- Updated .NET debugging services loader to address problem with debugging after installing XCode12 (dotnet/runtime/#42311)
- Fixed integrated terminal on non-Windows (#4203)
- Updated Razor support (PR: #4278)
- Update OmniSharp version to 1.37.5 (PR: #4299)
- Support auto doc comment generation (#8, PR: #4261)
- Add schema support for appsettings.json (#4279, PR: #4280)
- Add schema support for global.json (PR: #4290)
- Update remoteProcessPickerScript windows ssh exit (#3482, PR: #4225)
- Do not start OmniSharp server in Love Share scenarios (#3910, PR: #4038)
- Suppress codelens for IEnumerable.GetEnumerator (#4245, PR: #4246)
- Allow arm64 MacOS to debug dotnet projects (#4277, PR: #4288)
What's new in 1.23.7
- Update OmniSharp version to 1.37.4 (PR: #4224)
- Do not start OmniSharp server in Live Share scenarios (#3910, PR: #4038)
- Update remoteProcessPickerScript windows ssh exit (PR: #4225)
- Only suppress file changed notifications for C# files (#4178, PR: #4230)
- Suppress codelens for IEnumerable.GetEnumerator (#4245, PR: #4246)
What's new in 1.23.6
- Do not call updateBuffer if there are no changes. (PR: #4170)
- Only skip file changed events when document is open. (PR: #4178)
What's new in 1.23.5
- Set meaning of UseGlobalMono "auto" to "never" since Mono 6.12.0 still ships with MSBuild 16.7 (PR: #4130)
- Ensure that the rename identifier and run code action providers do not apply changes twice (PR: #4133)
- Do not send file changed events for .cs files (PR: #4141)
- Update Razor to 6.0.0-alpha1.20521.3:
- Improvements to HTML colorization for non-C# portions of the document.
- Bug fix - the
razor.format.enable
option is honored again
Emmet support in Razor files
To enable emmet support, add the following to your settings.json:
"emmet.includeLanguages": {
"aspnetcorerazor": "html"
}
Semantic Highlighting
The C# semantic highlighting support is in preview. To enable, set editor.semanticHighlighting.enabled
and csharp.semanticHighlighting.enabled
to true
in your settings. Semantic highlighting is only provided for code files that are part of the active project.
To really see the difference, try the new Visual Studio 2019 Light and Dark themes with semantic colors that closely match Visual Studio 2019.
Supported Operating Systems for Debugging
Found a Bug?
To file a new issue to include all the related config information directly from vscode by entering the command pallette with Ctrl+Shift+P
(Cmd+Shift+P on macOS) and running CSharp: Report an issue
command. This will open a browser window with all the necessary information related to the installed extensions, dotnet version, mono version, etc. Enter all the remaining information and hit submit. More information can be found on the wiki.
Alternatively you could visit https://github.com/OmniSharp/omnisharp-vscode/issues and file a new one.
Development
First install:
- Node.js (8.11.1 or later)
- Npm (5.6.0 or later)
To run and develop do the following:
- Run
npm i
- Run
npm run compile
- Open in Visual Studio Code (
code .
)
- Optional: run
npm run watch
, make code changes
- Press F5 to debug
To test do the following: npm run test
or F5 in VS Code with the "Launch Tests" debug configuration.
License
Copyright © .NET Foundation, and contributors.
The Microsoft C# extension is subject to these license terms.
The source code to this extension is available on https://github.com/OmniSharp/omnisharp-vscode and licensed under the MIT license.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant
to clarify expected behavior in our community.
For more information see the .NET Foundation Code of Conduct.
Contribution License Agreement
By signing the CLA, the community is free to use your contribution to .NET Foundation projects.
.NET Foundation
This project is supported by the .NET Foundation.