rules_dotnetAPI docs @0.20.5

@rules_dotnet//dotnet:defs.bzl

Public API surface is re-exported here.

Users should not load files under "/dotnet"

Functions & Macros

csharp_nunit_test
Parameters
kwargs
fsharp_nunit_test
Parameters
kwargs
nuget_repo
Parameters
*name
*packages

Rules

csharp_binary

Compile a C# exe

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
additionalfileslist of labels

Extra files to configure analyzers.

Default: []
allow_unsafe_blocksboolean

Allow compiling unsafe code. It true, /unsafe is passed to the compiler.

Default: False
nullablestring

Enable nullable context, or nullable warnings.

Default: "disable"
run_analyzersboolean

Controls whether analyzers run at build time.

Default: True
nowarnlist of strings

List of warnings that should be ignored

Default: ["CS1701", "CS1702"]
analyzer_configslist of labels

A list of analyzer configuration files. See: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files

Default: []
roll_forward_behaviorstring

The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior

Default: "Major"
winexeboolean

If true, output a winexe-style executable, otherwiseoutput a console-style executable.

Default: False
appsetting_fileslist of labels

A list of appsettings files to include in the output directory.

Default: []
envsdictionary: String → String

A dictionary of environment variables to set when the binary is run. Supports make variable expansion

Default: {}
include_host_model_dllboolean

Whether to include Microsoft.NET.HostModel from the toolchain. This is only required to build tha apphost shimmer.

Default: False
csharp_library

Compile a C# DLL

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
additionalfileslist of labels

Extra files to configure analyzers.

Default: []
allow_unsafe_blocksboolean

Allow compiling unsafe code. It true, /unsafe is passed to the compiler.

Default: False
nullablestring

Enable nullable context, or nullable warnings.

Default: "disable"
run_analyzersboolean

Controls whether analyzers run at build time.

Default: True
nowarnlist of strings

List of warnings that should be ignored

Default: ["CS1701", "CS1702"]
analyzer_configslist of labels

A list of analyzer configuration files. See: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files

Default: []
exportslist of labels

List of targets to add to the dependencies of those that depend on this target.
Use this sparingly as it weakens the precision of the build graph.

This attribute does nothing if you don't have strict dependencies enabled.

Default: []
is_analyzerboolean

Whether this library is an analyzer or not. This flag is needs to be set to true if the library is an analyzer or a source generator.

Default: False
is_language_specific_analyzerboolean

Whether this library is a language specific analyzer/source generator or not. This flag is needs to be set to true if the library is a analyzer that is specific to a language or if the library is a source generator.

Default: False
csharp_test

Compiles a C# executable and runs it as a test

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
additionalfileslist of labels

Extra files to configure analyzers.

Default: []
allow_unsafe_blocksboolean

Allow compiling unsafe code. It true, /unsafe is passed to the compiler.

Default: False
nullablestring

Enable nullable context, or nullable warnings.

Default: "disable"
run_analyzersboolean

Controls whether analyzers run at build time.

Default: True
nowarnlist of strings

List of warnings that should be ignored

Default: ["CS1701", "CS1702"]
analyzer_configslist of labels

A list of analyzer configuration files. See: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files

Default: []
roll_forward_behaviorstring

The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior

Default: "Major"
winexeboolean

If true, output a winexe-style executable, otherwiseoutput a console-style executable.

Default: False
appsetting_fileslist of labels

A list of appsettings files to include in the output directory.

Default: []
envsdictionary: String → String

A dictionary of environment variables to set when the binary is run. Supports make variable expansion

Default: {}
fsharp_binary

Compile a F# exe

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
nowarnlist of strings

List of warnings that should be ignored

Default: []
roll_forward_behaviorstring

The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior

Default: "Major"
winexeboolean

If true, output a winexe-style executable, otherwiseoutput a console-style executable.

Default: False
appsetting_fileslist of labels

A list of appsettings files to include in the output directory.

Default: []
envsdictionary: String → String

A dictionary of environment variables to set when the binary is run. Supports make variable expansion

Default: {}
fsharp_library

Compile a F# DLL

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
nowarnlist of strings

List of warnings that should be ignored

Default: []
exportslist of labels

List of targets to add to the dependencies of those that depend on this target.
Use this sparingly as it weakens the precision of the build graph.

This attribute does nothing if you don't have strict dependencies enabled.

Default: []
fsharp_test

Compile a F# executable and runs it as a test

AttributeTypeDescription
*namename

A unique name for this target.

depslist of labels

Other libraries, binaries, or imported DLLs

Default: []
datalist of labels

Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files.

Default: []
compile_datalist of labels

Additional compile time files.

Default: []
keyfilelabel

The key file used to sign the assembly with a strong name.

Default: None
langversionstring

The version string for the language.

Default: ""
resourceslist of labels

A list of files to embed in the DLL as resources.

Default: []
outstring

File name, without extension, of the built assembly.

Default: ""
*target_frameworkslist of strings

A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks

project_sdkstring

The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview

Default: "default"
defineslist of strings

A list of preprocessor directive symbols to define.

Default: []
internals_visible_tolist of strings

Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching.

Default: []
treat_warnings_as_errorsboolean

Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors.

Default: False
warnings_as_errorslist of strings

List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors.

Default: []
warnings_not_as_errorslist of strings

List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors.

Default: []
warning_levelinteger

The warning level that should be used by the compiler.

Default: 3
generate_documentation_fileboolean

Whether or not to generate a documentation file.

Default: True
compiler_optionslist of strings

Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute.

Default: []
srcslist of labels

The source files used in the compilation.

Default: []
nowarnlist of strings

List of warnings that should be ignored

Default: []
roll_forward_behaviorstring

The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior

Default: "Major"
winexeboolean

If true, output a winexe-style executable, otherwiseoutput a console-style executable.

Default: False
appsetting_fileslist of labels

A list of appsettings files to include in the output directory.

Default: []
envsdictionary: String → String

A dictionary of environment variables to set when the binary is run. Supports make variable expansion

Default: {}
publish_binary

Publish a .Net binary

AttributeTypeDescription
*namename

A unique name for this target.

*binarylabel

The .Net binary that is being published

self_containedboolean

Whether the binary should be self-contained.

If true, the binary will be published as a self-contained but you need to provide
a runtime pack in the runtime_packs attribute. At some point the rules might
resolve the runtime pack automatically.

If false, the binary will be published as a non-self-contained. That means that to be
able to run the binary you need to have a .Net runtime installed on the host system.

Default: False
*target_frameworkstring

The target framework that should be published

runtime_identifierstring

The runtime identifier that is being targeted. See https://docs.microsoft.com/en-us/dotnet/core/rid-catalog

Default: ""
roll_forward_behaviorstring

The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior

Default: "Minor"
import_library

Creates a target for a static DLL for a specific target framework

AttributeTypeDescription
*namename

A unique name for this target.

*library_namestring

The name of the library

versionstring

The version of the library

Default: ""
libslist of labels

Static runtime DLLs

Default: []
nativelist of labels

Native runtime DLLs

Default: []
analyzerslist of labels

Static analyzer DLLs

Default: []
analyzers_csharplist of labels

Static C# analyzer DLLs

Default: []
analyzers_fsharplist of labels

Static F# analyzer DLLs

Default: []
analyzers_vblist of labels

Static VB analyzer DLLs

Default: []
refslist of labels

Compile time DLLs

Default: []
resource_assemblieslist of labels

Resource assemblies

Default: []
depslist of labels

Other DLLs that this DLL depends on.

Default: []
datalist of labels

Other files that this DLL depends on at runtime

Default: []
targeting_pack_overridesdictionary: String → String

Targeting packs like e.g. Microsoft.NETCore.App.Ref have a PackageOverride.txt that includes a list of NuGet packages that should be omitted in a compiliation because they are included in the targeting pack

Default: {}
framework_listdictionary: String → String

Targeting packs like e.g. Microsoft.NETCore.App.Ref have a PlatformManifest.txt that includes all the DLLs that are included in the targeting pack. This is used to determine which version of a DLL should be used during compilation or runtime.

Default: {}
sha512string

The SHA512 sum of the NuGet package

Default: ""
nupkglabel

The .nupkg file providing this import

Default: None
import_dll

Imports a DLL

AttributeTypeDescription
*namename

A unique name for this target.

*dlllabel

The name of the library

versionstring

The version of the library

Default: ""
datalist of labels

Other files that this DLL depends on at runtime

Default: []
dotnet_tool

Run a .NET command-line tool hermetically via Bazel.

This rule allows you to run a pre-built .NET command-line tool that has been packaged
with NuGet. The tool is executed using the hermetic .NET runtime provided by rules_dotnet.

This is a lower-level API that requires a manual specification of tool details.
You should instead add the tool as a dependency to your Paket dependencies, and
use paket2bazel to generate Bazel targets; any tools found within the Paket
dependencies will automatically be exposed as Bazel targets in the resulting
nuget_repo rule.

AttributeTypeDescription
*namename

A unique name for this target.

*target_frameworkslist of strings

The target frameworks this tool was built for.

*entrypointdictionary: String → String

The entrypoint of the dotnet tool (the dll to execute), keyed by the target framework.

*runnerdictionary: String → String

The runner to use to execute the tool, keyed by the target framework. Currently, only 'dotnet' is supported.

*depslabel

The dependencies of the dotnet tool. Must include a DotnetToolInfo provider.

Repository Rules

nuget_archive
AttributeTypeDescription
*namename

A unique name for this repository.

repo_mappingdictionary: String → String

In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).

sourceslist of strings
Default: []
netrclabel
Default: None
idstring
Default: ""
versionstring
Default: ""
sha512string
Default: ""

@rules_dotnet//dotnet:extensions.bzl

extensions for bzlmod

Module Extensions

dotnet
Tag Classes
toolchain
AttributeTypeDescription
namename

Base name for generated repositories

Default: "dotnet"
dotnet_versionstring

Version of the .Net SDK

Default: ""

@rules_dotnet//dotnet:paket.paket2bazel_dependencies_extension.bzl

Generated

Module Extensions

paket2bazel_dependencies_extension

@rules_dotnet//dotnet:paket.paket2bazel_dependencies.bzl

GENERATED

Functions & Macros

paket2bazel_dependencies

paket2bazel_dependencies

@rules_dotnet//dotnet:paket.rules_dotnet_dev_nuget_packages_extension.bzl

Generated

Module Extensions

rules_dotnet_dev_nuget_packages_extension

@rules_dotnet//dotnet:paket.rules_dotnet_dev_nuget_packages.bzl

GENERATED

Functions & Macros

rules_dotnet_dev_nuget_packages

rules_dotnet_dev_nuget_packages

@rules_dotnet//dotnet:paket.rules_dotnet_nuget_packages_extension.bzl

Generated

Module Extensions

rules_dotnet_nuget_packages_extension

@rules_dotnet//dotnet:paket.rules_dotnet_nuget_packages.bzl

GENERATED

Functions & Macros

rules_dotnet_nuget_packages

rules_dotnet_nuget_packages

@rules_dotnet//dotnet:repositories.bzl

Rules to load all the .NET SDK & framework dependencies of rules_dotnet.

Functions & Macros

dotnet_register_toolchains

Convenience macro for users which does typical setup.

  • create a repository for each built-in platform like "dotnet_linux_amd64" -
    this repository is lazily fetched when node is needed for that platform.
  • create a repository exposing toolchains for each platform like "dotnet_platforms"
  • register a toolchain pointing at each platform
    Users can avoid this macro and do these steps themselves, if they want more control.
Parameters
*name

base name for all created repos, like "dotnet"

*dotnet_version

The .Net SDK version to use e.g. 8.0.100

register

whether to call through to native.register_toolchains.
Should be True for WORKSPACE users, but false when used under bzlmod extension

Default: True
kwargs

passed to each dotnet_repositories call

Repository Rules

dotnet_repositories

Fetch external tools needed for dotnet toolchain

AttributeTypeDescription
*namename

A unique name for this repository.

repo_mappingdictionary: String → String

In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).

*dotnet_versionstring
*platformstring

@rules_dotnet//dotnet:toolchain.bzl

Rules to configure the .NET toolchain of rules_dotnet.

Rules

dotnet_toolchain

Defines a dotnet compiler/runtime toolchain.

For usage see https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains.

AttributeTypeDescription
*namename

A unique name for this target.

runtimelabel

The dotnet CLI

Default: None
runtime_pathstring

Path to the dotnet CLI. Do not set if runtime is set

Default: ""
csharp_compilerlabel

The C# compiler binary

Default: None
csharp_compiler_pathstring

Path to the C# compiler binary. Do not set if csharp_compiler is set

Default: ""
fsharp_compilerlabel

The F# compiler binary

Default: None
fsharp_compiler_pathstring

Path to the F# compiler binary. Do not set if fsharp_compiler is set

Default: ""
host_modellabel

The System.NET.HostModel DLL

Default: None
*sdk_versionstring

The SDK version of the current dotnet SDK

*runtime_versionstring

The runtime version of the current dotnet SDK

*runtime_tfmstring

The runtime target framework moniker of the current dotnet SDK

*csharp_default_versionstring

The default C# version used by the current dotnet SDK

*fsharp_default_versionstring

The default F# version used by the current dotnet SDK

Providers

DotnetInfo

Information about the dotnet toolchain

Fields
runtime_path

Path to the dotnet executable

runtime_files

Files required in runfiles to make the dotnet executable available.

May be empty if the runtime_path points to a locally installed tool binary.

csharp_compiler_path

Path to the C# compiler executable

csharp_compiler_files

Files required in runfiles to make the C# compiler executable available.

May be empty if the csharp_compiler_path points to a locally installed tool binary.

fsharp_compiler_path

Path to the F# compiler executable

fsharp_compiler_files

Files required in runfiles to make the F# compiler executable available.

May be empty if the fsharp_compiler_path points to a locally installed tool binary.

apphost_path

Path to the apphost executable

apphost_files

Files required in runfiles to make the apphost executable available.

May be empty if the apphost_path points to a locally installed tool binary.

sdk_version

Version of the dotnet SDK

runtime_version

Version of the dotnet runtime

runtime_tfm

The target framework moniker for the current SDK

csharp_default_version

Default version of the C# language

fsharp_default_version

Default version of the F# language