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.
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.
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.
- Bump minimum required version of VS Code (PR: #4664)
- Change useGlobalMono scope to default (window) (PR: #4674)
- Fix a typo in package.json (PR: #4675)
- Update OmniSharp version to 1.37.14
- Update Roslyn to 4.0.0-2.21354.7 (PR: omnisharp-roslyn#2189)
- Update included Build Tools to match .NET SDK 6 Preview 6 (PR: omnisharp-roslyn#2187)
- Update to latest .NET SDKs (PR: omnisharp-roslyn#2197)
- Update included Build Tools to match .NET SDK 6 Preview 7 (PR: omnisharp-roslyn#2196)
- Upgrade McMaster.Extensions.CommandLineUtils to 3.1.0 (#4090, PR: omnisharp-roslyn#2192)
- Debugger changes:
- Fixes Razor editing support (PR: #4642)
- Show C# project files in the project selector (#4633, PR: #4644)
- Use new CompletionItem label API (#4640, PR: #4648)
- Support V2 version of GoToDefinition, which can show more than one location for partial types and show source-generated file information (PR: #4581)
- Add command 'listRemoteDockerProcess' and variable 'pickRemoteDockerProcess' (#4607, PR: #4617)
- Ensure we only start one instance of OmniSharp server (PR: #4612)
- Set the names of status bar items (PR: #4621)
- Add Debugger Languages (PR: #4626)
- Use temporary directory for debug sockets on NIX systems (PR: #4637)
- Update OmniSharp version to 1.37.12
- Include timing info in logged responses (PR: omnisharp-roslyn#2173)
- Defend against null value in BuildErrorEventArgs (omnisharp-roslyn#2171, PR: omnisharp-roslyn#2172)
- Updated to all the latest .NET SDKs (PR: omnisharp-roslyn#2166)
- Add support for GoToDefinition on source-generated files (PR: omnisharp-roslyn#2170)
- Add V2 version of GotoDefinitionService (PR: omnisharp-roslyn#2168)
- avoid NRE when document is null (PR: omnisharp-roslyn#2163))
- Update Roslyn to 4.0.0-2.21322.50 (PR: omnisharp-roslyn#2183)
- Added support for diagnostic suppressors (omnisharp-roslyn#1711, PR: omnisharp-roslyn#2182)
- Use the Microsoft.Build.Locator package for discovery (PR: omnisharp-roslyn#2181)
- Update build tools to match NET 6 Preview 5 (PR: omnisharp-roslyn#2175)
- Support experimental async completion (PR: #4116)
- Add option to to exclude custom symbols from codelens (#4335, PR: #4418)
- Handle ProcessPicker via resolveDebugConfiguration (PR: #4509)
- Update OmniSharp version to 1.37.10
- Update included toolset to match .NET 6 preview4 (PR: omnisharp-roslyn#2159)
- Add async completion support (PR: omnisharp-roslyn#1986)
- Only subscribe to AppDomain.AssemblyResolve once (PR: omnisharp-roslyn#2149)
- Update build tools to match .NET 6 Preview 3 SDK. (PR: omnisharp-roslyn#2134)
- Do not return null responses from BlockStructureService and CodeStructureService (PR: omnisharp-roslyn#2148)
- Strong-name sign OmniSharp assemblies (PR: omnisharp-roslyn#2143)
- Updated IL Spy to 7.0.0 stable (PR: omnisharp-roslyn#2142)
- Do not crash on startup when configuration is invalid (PR: omnisharp-roslyn#2140)
- Bump System.Text.Encodings.Web from 4.7.1 to 4.7.2 in /tools (PR: omnisharp-roslyn#2137)
- Correctly set compilation platform of the project (PR: omnisharp-roslyn#2135)
- Fix typo (PR: omnisharp-roslyn#2098)
- Rework completion resolution (omnisharp-roslyn#2123, PR: omnisharp-roslyn#2126)
- Report back the solution filter name in workspace updated event (PR: omnisharp-roslyn#2130)
- Debugger changes:
- Added support for osx-arm64 debugging (#4390)
- Added support for exception conditions. See documentation for more information (#4356).
- Fixed an issue with character encoding for multi-byte characters written to the debug console (#4398)
- Fixed a bug where Blazor WASM debugging would fail to launch correctly (dotnet/aspnetcore#31653)
To enable emmet support, add the following to your settings.json:
"emmet.includeLanguages": {
"aspnetcorerazor": "html"
}
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.
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
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.
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.
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.
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.
By signing the CLA, the community is free to use your contribution to .NET Foundation projects.
This project is supported by the .NET Foundation.