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.
- Fix typo in supressBuildAssetsNotification setting name (#3941, PR: #3942)
- Introduced a new
/quickinfo
endpoint to provide a richer set of information compared to/typeinfo
. Consumers are encouraged to use it as their hover provider (omnisharp-roslyn#1808, PR: omnisharp-roslyn#1860 - Added support for Roslyn
EmbeddedLanguageCompletionProvider
which enables completions for string literals forDateTime
andRegex
(omnisharp-roslyn#1871) - Improve performance of the
textDocument/codeAction
request. (PR: omnisharp-roslyn#1814) - Provide a warning when the discovered MSBuild version is lower than the minimumMSBuildVersion supported by the configured SDK (PR: omnisharp-roslyn#1875)
- Use the real MSBuild product version during discovery (PR: omnisharp-roslyn#1876)
- Fixed debugging in .NET 5 preview SDKs (#3459, PR: omnisharp-roslyn#1862)
- Move omnisharp vscode to the new hover implementation (#3928)
- Ignore screen size is bogus errors with ps (#3580, PR: #3961)
- Fix all providers support (PR: #3440, PR: omnisharp-roslyn#1581)
- Updated Razor support
- Improved Semantic Highlighting support by fixing some scenarios which might lead to thrown exceptions and incorrect results. dotnet/aspnetcore-tooling#2126
- Fixed support in the case of projects with spaces in path. dotnet/aspnetcore#23336
- Various performance improvements.
@inject
completion dotnet/aspnetcore#22886- Improved behavior in cases where directory is not available. [dotnet/razor#2008](https://github.com/dotnet/ aspnetcore-tooling/pull/2008)
- Added the
Extract to CodeBehind
light bulb code action. dotnet/aspnetcore-tooling#2039
- Use global MSBuild property when resetting target framework (omnisharp-roslyn#1738, PR: omnisharp-roslyn#1846)
- Do not use Visual Studio MSBuild if it doesn't have .NET SDK resolver (omnisharp-roslyn#1842, omnisharp-roslyn#1730, PR: omnisharp-roslyn#1845)
- Only request dotnet info once for the solution or directory (omnisharp-roslyn#1844, PR: omnisharp-roslyn#1857)
- Allow client to specify symbol filter for FindSymbols Endpoint. (PR: omnisharp-roslyn#1823)
- Upgraded to Mono 6.10.0.105, msbuild 16.6 and added missing targets (PR: omnisharp-roslyn#1854)
- Make "Run/debug tests in context" position a link (#3915)
- Update browser launch regex to support non-default logging frameworks (#3842)
- Added LSP handler for
textDocument/codeAction
request. (PR: omnisharp-roslyn#1795) - Expose a custom LSP
omnisharp/client/findReferences
command via code lens (meant to be handled by LSP client). (PR: #omnisharp-roslyn/1807) - Added
DirectoryDelete
option toFileChangeType
allowing clients to report deleted directories that need to be removed (along all the files) from the workspace (PR: #3829, PR: omnisharp-roslyn#1821) - Do not crash when plugin assembly cannot be loaded (omnisharp-roslyn#1307, PR: omnisharp-roslyn#1827)
- Update browser launch regex to support non-default logging frameworks (#3842)
- Improved support for Codespaces
- Add setting for enabling go to decompilation (PR: #3774)
- Add experimental Semantic Highlighter
csharp.semanticHighlighting.enabled
(#3565, PR: #3667 - Add commands for Run and Debug Tests in Context (PR: #3772, PR: omnisharp-roslyn#1782)
- Do not add references CodeLens to Dispose methods (#3243, PR: #3780)
- Add Visual Studio 2019 themes with semantic colors (PR: #3790)
- Added support for
WarningsAsErrors
in csproj files (PR: omnisharp-roslyn#1779) - Added support for
WarningsNotAsErrors
in csproj files (omnisharp-roslyn#1681, PR: #1784) - Improved MSBuild scoring system (omnisharp-roslyn#1783, PR: omnisharp-roslyn#1797)
- Updated OmniSharp.Extensions.LanguageServer to
0.14.2
to fix synchronisation (PR: omnisharp-roslyn#1791) - Add test discovery and NoBuild option to test requests (PR: omnisharp-roslyn#1719)
- Updated Razor support
- Enable Semantic Highlighting for Razor TagHelpers and Blazor components (dotnet/aspnetcore#21713)
- Add support for Blazor WebAssembly-specific debug adapter (dotnet/aspnetcore-tooling#1885)
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.