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.
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.
- Update OmniSharp version to 1.37.4 (PR: #4224)
- Fixed global Mono MSBuild version reporting (PR: omnisharp-roslyn#1988)
- Fixed incremental changes and completion in Cake (PR: omnisharp-roslyn#1997)
- Omnisharp now uses libPaths and sourcePaths defined in custom .rsp file for scripting (PR: omnisharp-roslyn#2000)
- C# scripting should use language version "latest" by default (PR: omnisharp-roslyn#2001)
- Improve handling with Cake Script Service (PR: omnisharp-vscode#2013)
- Updated to latest Dotnet.Script scripting packages for .NET 5.0 (omnisharp-vscode#2020, PR: omnisharp-vscode#2012)
- Updated Roslyn to
3.8.0
, MSBuild to16.8.0
, DotNetHostResolver to5.0.0
, Nuget packages to5.8.0-rc.6930
and MSBuildSDKResolver to5.0.101-servicing.20564.2
to match .NET 5.0.100 SDK (PR: omnisharp-vscode#2015, omnisharp-vscode#2016) - Workspace create file workaround for VS Code (to avoid race condtion on newly created files) (omnisharp-vscode#4181, PR: omnisharp-vscode#2019)
- Response file can now used enviroment variables in the path + more error handling (PR: omnisharp-vscode#2008)
- 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)
- Do not call updateBuffer if there are no changes. (PR: #4170)
- Only skip file changed events when document is open. (PR: #4178)
- 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
- Use incremental changes to update language server (PR: #4088)
- Set meaning of UseGlobalMono "auto" to "always" now that Mono 6.12.0 ships with MSBuild 16.8 (PR: #4115)
- Updated OmniSharp to 1.37.3
- Fixed a bug when the server wouldn't start on MacOS/Linux when a username contained a space (PR: omnisharp-roslyn/#1979)
- Update to Mono 6.12.0 (PR: omnisharp-roslyn/#1981)
- Fix responsiveness regression with targeted DiagnosticWorker revert (omnisharp-roslyn/#1982, omnisharp-roslyn/#1983, PR: omnisharp-roslyn/#1984)
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.