csharp-ls 0.29.0

dotnet tool install --global csharp-ls --version 0.29.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local csharp-ls --version 0.29.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=csharp-ls&version=0.29.0
                    
nuke :add-package csharp-ls --version 0.29.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.

AI Assistance

This project has been developed with substantial help from LLMs, including the following models:

  • anthropic/claude-opus-4-6
  • anthropic/claude-sonnet-4-6
  • anthropic/claude-sonnet-5

Source files carry an Assisted-by: header line per the Linux kernel coding-assistants convention.

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 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 11 SDK or later to be installed on your machine; it can still load projects targeting older frameworks (e.g. net10.0). 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.

They can also be passed in the initialize request's initializationOptions, in the same shape as workspace/didChangeConfiguration settings, e.g. { "csharp": { "razorSupport": true } }; this suits clients that configure a server per connection rather than through a global workspace configuration. Each setting is taken from the last of these that sets it: command line arguments, initializationOptions, extended client capabilities, then workspace configuration.

  • csharp.logLevel - log level for server output forwarded via $/logTrace; one of trace, debug, info, warning, error; defaults to info

  • csharp.applyFormattingOptions - use formatting options as supplied by the client (may override .editorconfig values); defaults to false

  • csharp.analyzersEnabled - run Roslyn analyzers (e.g. IDE style rules, third-party NuGet analyzers) as part of diagnostics; increases diagnostic latency and CPU usage; defaults to false

  • csharp.useMetadataUris - serve decompiled metadata and source-generated documents under csharp:/ URIs; defaults to false

  • csharp.razorSupport - enable Razor (.cshtml) document support; defaults to false

  • csharp.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 --solution CLI flag; defaults to null

  • csharp.locale - force the output language for diagnostics and messages, e.g. en-US or de; useful for consistent logs across different OS locales; overrides DOTNET_CLI_UI_LANGUAGE; defaults to the system locale

  • csharp.debug.solutionLoadDelay - delay in milliseconds before loading the solution after the workspace is ready

  • csharp.debug.debugMode - enable debug mode, which logs periodic request queue statistics; defaults to false

Command Line Arguments

USAGE: csharp-ls [--help] [--version] [--loglevel <level>] [--solution <solution>] [--locale <locale>] [--debug] [--diagnose] [--features <features>] [--rpclog <path>]

OPTIONS:

    --version, -v         display versioning information
    --loglevel, -l <level>
                          set log level, <trace|debug|info|warning|error>; default is `info`
    --solution, -s <solution>
                          specify .sln file to load (relative to CWD)
    --locale, -L <locale> force output locale, e.g. `en-US` or `de`; overrides DOTNET_CLI_UI_LANGUAGE
    --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.

Environment Variables

  • DOTNET_CLI_UI_LANGUAGE - sets the output locale for diagnostics and messages (e.g. en-US, de); follows the standard dotnet CLI convention; overridden by --locale / csharp.locale if set

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 and Source-Generated Document URIs

When enabled, textDocument/definition on symbols in compiled assemblies or source-generated files returns a virtual csharp:/ URI instead of a temporary file path. The URI can then be passed to the custom csharp/metadata request to retrieve the decompiled or generated source text.

  • Decompiled symbols: csharp:/<project.csproj>/decompiled/<Symbol>.cs
  • Source-generated files: csharp:/<project.csproj>/generated/<HintName>

This 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:

Acknowledgements

Alternatives

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.29.0 68,897 11/18/2026
0.28.0 205,401 9/13/2026
0.27.0 51,854 8/24/2026
0.26.0 168,801 7/15/2026
0.25.0 75,573 6/11/2026
0.24.0 258,545 4/16/2026
0.23.0 65,312 4/8/2026
0.22.0 326,819 2/5/2026
0.21.0 94,615 1/2/2026
0.20.0 41,132 11/13/2025
0.19.0 108,195 8/20/2025
0.18.0 33,011 6/23/2025
0.17.0 22,000 4/30/2025
0.16.0 43,757 12/24/2024
0.15.0 55,602 8/15/2024
0.14.0 17,676 6/23/2024
0.13.0 19,235 5/8/2024
0.12.0 8,319 4/22/2024
0.11.0 32,773 1/21/2024
0.10.0 20,328 11/4/2023
Loading failed