Table of Contents

C# layer

Table of ContentsClose

csharp.png

1. Description

This layer adds support for the C# language using the omnisharp-roslyn language server with the lsp-mode package.

1.1. Features:

  • Syntax checking with flycheck (when syntax-checking layer is used)
  • Support for auto-completion (when auto-completion layer is used)
  • Refactoring
  • Navigation to cross-references
  • Inspecting types in metadata

2. Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add csharp to the existing dotspacemacs-configuration-layers list in this file.

You can also disable the LSP backend by setting the csharp-backend variable when configuring the layer:

  • lsp (the default)
  • nil (to not use any language server)
(csharp :variables csharp-backend nil)  ;disable the language server

2.1. Omnisharp backend

Before you can work with C# files you will need to install the server using the instructions at omnisharp-emacs/doc/server-installation.md.

3. Caveats

  • You should use dotnet CLI tool from .NET Core download page or an IDE like Visual Studio or Xamarin Studio to manage solution and project files.
  • Debugging on command line is possible using SDB.

4. Key bindings

LSP-backend uses key bindings that are common for all layers/languages using the lsp layer.

Author: root

Created: 2026-02-09 Mon 20:56

Validate