csharp-ls
0.23.0
dotnet tool install --global csharp-ls --version 0.23.0
dotnet new tool-manifest
dotnet tool install --local csharp-ls --version 0.23.0
#tool dotnet:?package=csharp-ls&version=0.23.0
nuke :add-package csharp-ls --version 0.23.0
Description
csharp-ls brings advanced language features like code completion, diagnostics, and refactoring to your editor for C# projects. It supports projects targeting older .NET SDK versions including .NET Core 3, .NET Framework 4.8, and potentially earlier ones.
csharp-ls is MIT-licensed (see LICENSE) and is provided with no warranty of any kind.
Documentation
See CHANGELOG.md for the list of recent improvements/fixes.
See docs/features.md for a more detailed discussion regarding features and customization provided with csharp-ls.
See docs/troubleshooting.md for server troubleshooting and diagnostics.
See docs/contributing.md for build instructions and codebase overview.
See docs/codebase-architecture.md for an overview of the project structure, LSP message handling, request scheduling, and test infrastructure.
Quick Start
csharp-ls requires the .NET 10 SDK or later to be installed on your machine. Please head to Download .NET to download it.
The server can be installed as csharp-ls dotnet tool:
dotnet tool install --global csharp-ls
Once installed, your editor's LSP client should automatically detect and start
csharp-ls when opening C# project files.
Settings
Configuration
Settings are read from the csharp workspace configuration section
(workspace/configuration) and can also be provided via workspace/didChangeConfiguration.
csharp.logLevel- log level for server output forwarded via$/logTrace; one oftrace,debug,info,warning,error; defaults toinfocsharp.applyFormattingOptions- use formatting options as supplied by the client (may override.editorconfigvalues); defaults tofalsecsharp.useMetadataUris- serve decompiled metadata sources undercsharp:/URIs instead of temp files; defaults tofalsecsharp.razorSupport- enable Razor (.cshtml) document support; defaults tofalsecsharp.solutionPathOverride- override the solution path to load; useful for specifying an alternative solution when multiple exist in the workspace; can also be set via the--solutionCLI flag; defaults tonullcsharp.debug.solutionLoadDelay- delay in milliseconds before loading the solution after the workspace is readycsharp.debug.debugMode- enable debug mode, which logs periodic request queue statistics; defaults tofalse
Command Line Arguments
USAGE: csharp-ls [--help] [--version] [--loglevel <level>] [--solution <solution>]
[--debug] [--diagnose] [--features <features>] [--rpclog <path>]
OPTIONS:
--version, -v display versioning information
--loglevel, -l <level>
set log level (<trace|debug|info|warning|error>);
equivalent to csharp.logLevel; default is `info`
--solution, -s <solution>
specify .sln file to load (relative to CWD)
--debug enable debug mode
--diagnose run diagnostics
--features, -f <features>
enable optional features, comma-separated: [metadata-uris, razor-support]
--rpclog <path> write RPC wire log to file (READ/WRITE/ERROR/...)
--help display this list of options.
See csharp-ls --help.
LSP Tracing
csharp-ls supports the LSP $/setTrace and $/logTrace notifications. When a
client sets tracing to messages or verbose, the server forwards its internal
log output as $/logTrace notifications. This is independent of --loglevel,
which only controls stderr console output. In VS Code, tracing can be enabled
via the [langId].trace.server setting.
Extended Client Capabilities
Decompiled Code/Metadata URIs
csharp:/ metadata URIs can be enabled via the csharp.useMetadataUris
configuration setting, the --features metadata-uris CLI flag, or by setting
the experimental.csharp.metadataUris client capability to true.
Razor (.cshtml) support
Can be enabled via the csharp.razorSupport configuration setting or by passing
the --features razor-support CLI flag.
Clients
csharp-ls implements the standard LSP protocol to interact with your editor.
However, there are some features that require a non-standard implementation.
This is where editor-specific plugins can be helpful.
Notable clients:
- Neovim: csharpls-extended-lsp.nvim
- Emacs: emacs/lsp-mode
- Visual Studio Code: vscode-csharp-ls @ github
Acknowledgements
- csharp-ls is not affiliated with Microsoft Corp.,
- csharp-ls uses Roslyn to parse and update code,
- csharp-ls uses the LSP interface from the Ionide.LanguageServerProtocol project,
- csharp-ls uses ILSpy/ICSharpCode.Decompiler to decompile types in assemblies to C# source.
Alternatives
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.23.0 | 27,436 | 4/8/2026 |
| 0.22.0 | 280,790 | 2/5/2026 |
| 0.21.0 | 87,742 | 1/2/2026 |
| 0.20.0 | 27,599 | 11/13/2025 |
| 0.19.0 | 106,264 | 8/20/2025 |
| 0.18.0 | 31,126 | 6/23/2025 |
| 0.17.0 | 19,747 | 4/30/2025 |
| 0.16.0 | 37,872 | 12/24/2024 |
| 0.15.0 | 51,939 | 8/15/2024 |
| 0.14.0 | 16,476 | 6/23/2024 |
| 0.13.0 | 18,132 | 5/8/2024 |
| 0.12.0 | 7,738 | 4/22/2024 |
| 0.11.0 | 32,050 | 1/21/2024 |
| 0.10.0 | 19,727 | 11/4/2023 |
| 0.9.0 | 18,836 | 8/12/2023 |
| 0.8.0 | 17,928 | 5/6/2023 |
| 0.7.1 | 6,650 | 4/8/2023 |
| 0.7.0 | 3,612 | 3/25/2023 |
| 0.6.1 | 6,312 | 2/26/2023 |
| 0.6.0 | 8,189 | 12/30/2022 |