Skip to main content
Total Downloads
388.0K
387,988
Published
Aug 25, 2025
1y ago

Get Started

dotnet add package DafnyLanguageServer --version 4.11.0
ProductVersions
.NET
net8.0

README

DafnyLS

DafnyLS is a language server for Dafny. It is implemented in C# on .NET with OmniSharp's C# Language Server Protocol.

Running

Place the Z3 executable in the language server's root directory or within the z3/bin subdirectory (already present in the release packages). If not on windows, ensure that the executable has execution permissions:

chmod u+x ./z3/bin/z3

The language server can be started either by the executable itself (e.g., DafnyLanguageServer.exe on windows) or with the following command.

dotnet DafnyLanguageServer.dll

Configuration

The language server can be configured using the DafnyLanguageServer.appsettings.json file as well as using CLI arguments.

For example, if you want to configure the automatic verification through the command line:

dotnet DafnyLanguageServer.dll --documents:verify=onsave

Or using the DafnyLanguageServer.appsettings.json configuration file:

{
  "Documents": {
    "Verify": "onsave"
  }
}

Options provided through the command line have higher priority than the options provided within DafnyLanguageServer.appsettings.json.

Documents

# Sets when the automatic verification should be applied.
# Options:
# - never - Never verifies the document.
# - onchange - Verifies the document with each change.
# - onsave - Verifies the document each time it is saved.
# default: onchange
--documents:verify=onchange

Verifier

# Sets maximum execution time (in seconds) for verifications
# Default: 0 (no time limit)
--verifier:timelimit=0

# Sets the maximum number of virtual cores to use. 
# Default: 0 (use half of the available virtual cores).
--verifier:vcscores=0

# Set the caching policy (like /verifySnapshots for Dafny.exe)
# Default: 0 (no caching).
--verifier:verifysnapshots=0

# Set whether or not to compute and report verification gutter statuses
# Default: 0 (no gutter status reported).
--verifier:gutterStatus=true

Ghost Diagnostics

# Mark ghost statements
# Default: true (mark the statements)
--ghost:markStatements=true

Plugins

# Provides a path to assemblies and optional space-separated command-line arguments after a comma.
# Repeat with --dafny:plugins:0=... --dafny:plugins:1=... for multiple plugins.
--dafny:plugins:0=path\to\example.dll
--dafny:plugins:0=path/to/example2.dll,oneArgument
--dafny:plugins:0=example3.dll,"firstArgument with \" space and quote" secondArgument

# On the command-line, you'd use the following escapes for the first and third examples:
"--dafny:plugins:0=path\\to\\example.dll"
"--dafny:plugins:0=example3.dll,\"firstArgument with \\\" space and quote\" secondArgument"

# For just the dafny executable, replace `--dafny:plugins:X` by `--plugin:` that you can repeat.

Downloads by Version

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.The published metadata declares 15 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.