C# for Visual Studio Code (powered by OmniSharp)
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.
- .NET 6 SDK or newer when
omnisharp.useModernNet is set to
true (the default value).
- A Full Framework runtime and MSBuild tooling when
omnisharp.useModernNet is set to
Get Started Writing C# in VS Code
.NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild tooling (See announcement omnisharp-roslyn#2339). To ensure that the C# extension remains usable out of the box for .NET SDK projects, we have changed the default value of
If you still need Unity or .NET Framework support, you can set
false in your VS Code settings and restart OmniSharp. Please see the Requirements section above to ensure necessary tooling is installed.
See issue #5120 for more details.
What's new in 1.25.4
- Update OmniSharp to 1.39.4 (PR: #5544)
- Disable snippets in sync completion (PR: #2497)
What's new in 1.25.3
- Update Razor to 7.0.0-preview.23067.5 (PR: #5543)
- Enables support for arm64
- Adds document color and color presentation features
- Update Roslyn to 4.5.0-2.22527.10 (PR: #2486)
- Update dotnet-script dependencies to 1.4.0 (PR: #2477)
- Register the LanguageServerLogger only once (PR: #2473)
- Fix extension not finding mono. (#5454, PR: #5484)
- Update debugger to 1.25.3. (#5460, PR: #5489)
- Fix missing fix all commands. (#5474, PR: #5475)
- Fix failure to parse sdk version and sdk path. (#2412, PR: #5459)
- Handle custom OmniSharp launch paths. (#5449, PR: #5456)
What's new in 1.25.2
- Fix the MSBuild version check on Unix and Linux platforms. (#5443, PR: #5444)
What's new in 1.25.1
.editorconfig support is enabled (on by default), it is given higher priority over the legacy
omnisharp.json code formatting options. If you would like to have the
omnisharp.json code formatting options respected, disable
.editorconfig support by setting
- Fix csharp.unitTestDebuggingOptions description (#5309, PR: #5315)
- Removed quoted examples from omnisharp.sdkVersion and omnisharp.sdkPath (omnisharp-roslyn#2412, PR: #5301)
- Added an example on how to launch swagger ui (PR: #5283)
- Package manager nullability fixes (PR: #5255)
- Return all launch targets when
maxProjectResults is set to 0 (#5227, PR: #5241)
- Clear nullability warnings (PR: #5236)
- Provide actionable error messages for .NET SDK issues (#5223, PR: #5225)
- Clear all strict mode violations in src & enforce strict mode (PR: #5407)
- Update debugger to 1.25.1 (PR: #5415)
- Add github action to merge master to feature branches (PR: #5414
- coreclr-debug nullability (PR: #5405)
- Feature nullability (PR: #5400)
- Add prerequisite check for running OmniSharp. (PR: #5397)
- Add projectFilesIncludePattern & projectFilesExcludePattern options. (PR: #5382))
- Replaced the deprecated ProjectDiagnosticStatus event with the newer BackgroundDiagnosticStatus. (PR: #5372)
- Implement the "dotNetCliPaths" option to support custom .NET SDK locations (PR: #4738)
- Make the sourceGeneratedDocumentProvider always lazy (PR: #5340)
- Reintroduce typing version bumps (PR: #5350)
- Observer nullability fixes (PR: #5349)
- Support generated files in referenceProvider (PR: #5339)
- Provide source generated file info for workspace symbols (PR: #5338)
- Provide CodeActionKind for code actions (PR: #5337)
- Fix alpine support (PR: #5322)
- Update OmniSharp to 1.39.2 (PR: #5319)
What's new in 1.25.0
- Make SDK build of OmniSharp the default (#5120, PR: #5176)
- Add auto complete name to class, interface, enum, struct etc. snippets (PR: #5198)
- Add a fallback for ps in remoteProcessPickerScript (#4096, PR: #5207)
- Clear nullability warnings in server/omnisharp.ts (PR: #5199)
- Fix nullability for autoStart preferredPath (PR: #5192)
- coreclr debug configuration should support input variables for envFile (#5102, PR: #5189)
- Fix small spelling mistake (PR: #5215)
- Low-hanging nullable fruit (PR: #5186)
- Fire a buffer update instead of filechanged when active editor changes (#5216, PR: #5218)
- Add support for InlayHint.TextEdits (PR: #5177)
- Fix .net6 OmniSharp acquisition on Linux arm64 (PR: #5172)
- Remove project.json reference in debugger.md (PR: #5210)
- Update debugger to 1.24.5 (PR: #5211)
- Update OmniSharp to 1.39.0 (PR: #5219)
Emmet support in Razor files
To enable emmet support, add the following to your settings.json:
Supported Operating Systems for Debugging
Currently, the C# debugger officially supports the following operating systems:
- X64 operating systems:
- Windows 7 SP1 and newer
- macOS 10.12 (Sierra) and newer
- Linux: see .NET Core documentation for the list of supported distributions. Note that other Linux distributions will likely work as well as long as they include glibc and OpenSSL.
- ARM operating systems:
- Linux is supported as a remote debugging target
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.
- Node.js (8.11.1 or later)
- Npm (5.6.0 or later)
To run and develop do the following:
npm run compile
- Open in Visual Studio 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.
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.
This project is supported by the .NET Foundation.