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.
- 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.9
- 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)
- Support solution filters (*.slnf) (PR: #4481)
- Prompt user to install Blazor WASM companion extension if needed (PR: #4392)
- Add path to dotnet so child processes can use the CLI (PR: #4459)
- Give more information when Mono is missing or invalid. (#4428, PR: #4431)
- Revert incremental change forwarding (PR: #4477)
- Fixes to asset generation (PR: #4402)
- Add properties to blazorwasm debug configuration. (dotnet/aspnetcore#30977, PR: i#4445)
- Avoid white status bar items to ensure contrast (#4384, PR: #4385)
- Update OmniSharp to 1.37.8
- Update Roslyn version to
3.10.0-1.21125.6
(PR: omnisharp-roslyn#2105) - Update included build tools to closely match NET 6 Preview 1 SDK (PR: omnisharp-roslyn#2103)
- Improve custom error messages for MSB3644 (PR: omnisharp-roslyn#2097)
- Do not call FindReferencesAsync for null symbol (omnisharp-roslyn#2054, PR: omnisharp-roslyn#2089)
- use an OmniSharp specific message for MSB3644 (omnisharp-roslyn#2029, PR: omnisharp-roslyn#2069)
- changed the default RunFixAllRequest timeout to 10 seconds (PR: omnisharp-roslyn#2066)
- Support Solution filter (.slnf) (PR: omnisharp-roslyn#2121)
- updated to IL Spy 7.0.0.6372 (PR: omnisharp-roslyn#2113)
- Add sentinel file to MSBuild to enable workload resolver (#4417, PR: omnisharp-roslyn#2111)
- fixed CS8605 "Unboxing possibly null value" (PR: omnisharp-roslyn#2108)
- Update Roslyn version to
- Updated Razor support (PR: #4470)
- Bug fixes
- Add option to organize imports during document formatting. (PR: #4302)
- Update to use zero based indexes (PR: #4300)
- Improve request queues to improve code completion performance (PR: #4310)
- Add setting to control whether to show the OmniSharp log on error (#4102, #4330, PR: #4333)
- Support building launch assets for NET6-NET9 projects (#4346, PR: #4349)
- Add debugger support for Concord extensions. See the ConcordExtensibilitySamples wiki for more information.
- Update OmniSharp version to 1.37.6
- Handle records in syntax highlighting (#2048, PR: #2049)
- Remove formatting on new line (PR: #2053)
- Validate highlighting ranges in semantic highlighting requests (PR: #2055)
- Delay project system init to avoid solution update race (PR: #2057)
- Use "variable" kind for parameter completion (#2060, PR: #2061)
- Log request when response fails (#2064)
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
- X64 operating systems:
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.