This is part of the Fake.DotNet.Cli module.

DotNet

Nested types and modules

TypeDescription
BuildConfiguration

build configuration

BuildOptions

dotnet build command options

CliArchitecture

.NET Core SDK architecture

CliInstallOptions

.NET Core SDK install options

CliVersion

.NET Core SDK version (used to specify version when installing .NET Core SDK)

FirstArgReplacement
InfoOptions

dotnet --info command options

InfoResult

dotnet info result

InstallerOptions

.NET Core SDK installer download options

MSBuildOptions

dotnet restore command options

NewLanguage

the languages supported by new command

NewOptions

dotnet new command options

NuGetPushOptions

nuget push parameters for dotnet nuget push

Options

dotnet cli command execution options

PackOptions

dotnet pack command options

PublishOptions

dotnet publish command options

RestoreOptions

dotnet restore command options

TemplateInstallOptions

dotnet new --install options

TemplateUninstallOptions

dotnet new --install options

TestOptions

dotnet test command options

Verbosity

dotnet restore verbosity

VersionOptions

dotnet --version command options

VersionResult

dotnet info result

ModuleDescription
BuildConfiguration
CliChannel

Specifies the source channel for the installation.

Options
Versions

The a list of well-known versions to install

Functions and values

Function or valueDescription
DotNet.build setParams project
Signature: setParams:(BuildOptions -> BuildOptions) -> project:string -> unit

Execute dotnet build command

Parameters

  • 'setParams' - set compile command parameters
  • 'project' - project to compile
DotNet.defaultSystemInstallDir
Signature: string

.NET Core SDK default install directory (set to default SDK installer paths (/usr/local/share/dotnet or C:\Program Files\dotnet))

DotNet.defaultUserInstallDir
Signature: string

.NET Core SDK default install directory (set to default SDK installer paths (%HOME/.dotnet or %LOCALAPPDATA%/Microsoft/dotnet).

DotNet.downloadInstaller(setParams)
Signature: setParams:(InstallerOptions -> InstallerOptions) -> string

Download .NET Core SDK installer

Parameters

  • 'setParams' - set download installer options
DotNet.exec buildOptions command args
Signature: buildOptions:(Options -> Options) -> command:string -> args:string -> ProcessResult

Execute raw dotnet cli command

Parameters

  • 'buildOptions' - build common execution options
  • 'command' - the sdk command to execute 'test', 'new', 'build', ...
  • 'args' - command arguments
DotNet.findPossibleDotnetCliPaths(...)
Signature: dotnetCliDir:string option -> seq<string>

Get dotnet cli executable path. Probes the provided path first, then as a fallback tries the system PATH

Parameters

  • 'dotnetCliDir' - the path to check else will probe system PATH
DotNet.getSDKVersionFromGlobalJson()
Signature: unit -> string

Gets the DotNet SDK from the global.json This file can exist in the working directory or any of the parent directories

DotNet.getVersion(setParams)
Signature: setParams:(VersionOptions -> VersionOptions) -> string

Execute dotnet --version command

Parameters

  • 'setParams' - set version command parameters
DotNet.info(setParams)
Signature: setParams:(InfoOptions -> InfoOptions) -> InfoResult

Execute dotnet --info command

Parameters

  • 'setParams' - set info command parameters
DotNet.install(setParams)
Signature: setParams:(CliInstallOptions -> CliInstallOptions) -> Options -> Options

Install .NET Core SDK if required

Parameters

  • 'setParams' - set installation options
DotNet.installTemplate(...)
Signature: templateName:string -> setParams:(TemplateInstallOptions -> TemplateInstallOptions) -> unit

Execute dotnet new --install command to install a new template

Parameters

  • 'templateName' - template short name to install
  • 'setParams' - set version command parameters
DotNet.LatestPreview4ToolingOptions(...)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use a stable release at this point")>]
OBSOLETE

Please use a stable release at this point

.NET Core SDK install options preconfigured for preview4 tooling

DotNet.msbuild setParams project
Signature: setParams:(MSBuildOptions -> MSBuildOptions) -> project:string -> unit

Runs a MSBuild project

Parameters

  • setParams - A function that overwrites the default MSBuildOptions
  • project - A string with the path to the project file to build.

Sample

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
open Fake.DotNet
let setMsBuildParams (defaults:MSBuild.CliArguments) =
        { defaults with
            Verbosity = Some(Quiet)
            Targets = ["Build"]
            Properties =
                [
                    "Optimize", "True"
                    "DebugSymbols", "True"
                    "Configuration", "Release"
                ]
         }
let setParams (defaults:DotNet.MSBuildOptions) =
        { defaults with
            MSBuildParams = setMsBuildParams defaults.MSBuildParams
         }

DotNet.msbuild setParams "./MySolution.sln"
namespace Fake
namespace Fake.DotNet
val setMsBuildParams : defaults:MSBuild.CliArguments -> MSBuild.CliArguments
val defaults : MSBuild.CliArguments
module MSBuild

from Fake.DotNet
type CliArguments =
  { Targets: string list
    Properties: (string * string) list
    MaxCpuCount: int option option
    DoRestore: bool
    NoLogo: bool
    NodeReuse: bool
    ToolsVersion: string option
    Verbosity: MSBuildVerbosity option
    NoConsoleLogger: bool
    WarnAsError: string list option
    ... }
    static member Create : unit -> CliArguments
union case Option.Some: Value: 'T -> Option<'T>
union case MSBuildVerbosity.Quiet: MSBuildVerbosity
val setParams : defaults:DotNet.MSBuildOptions -> DotNet.MSBuildOptions
val defaults : DotNet.MSBuildOptions
module DotNet

from Fake.DotNet
type MSBuildOptions =
  { Common: Options
    MSBuildParams: CliArguments }
    member WithCommon : f:(Options -> Options) -> MSBuildOptions
    member WithEnvironment : map:Map<string,string> -> MSBuildOptions
    member WithMSBuildParams : f:(CliArguments -> CliArguments) -> MSBuildOptions
    member WithRedirectOutput : shouldRedirect:bool -> MSBuildOptions
    member Environment : Map<string,string>
    static member Create : unit -> MSBuildOptions
type MSBuildParams =
  { ToolPath: string
    WorkingDirectory: string
    Targets: string list
    Properties: (string * string) list
    MaxCpuCount: int option option
    DoRestore: bool
    NoLogo: bool
    NodeReuse: bool
    RestorePackagesFlag: bool
    ToolsVersion: string option
    ... }
    member WithEnvironment : map:Map<string,string> -> MSBuildParams
    static member Create : unit -> MSBuildParams
DotNet.MSBuildOptions.MSBuildParams: MSBuild.CliArguments
val msbuild : setParams:(DotNet.MSBuildOptions -> DotNet.MSBuildOptions) -> project:string -> unit
DotNet.newFromTemplate(...)
Signature: templateName:'?12687 -> setParams:(NewOptions -> NewOptions) -> unit
Type parameters: '?12687

Execute dotnet new command

Parameters

  • 'templateName' - template short name to create from
  • 'setParams' - set version command parameters
DotNet.nugetPush setParams nupkg
Signature: setParams:(NuGetPushOptions -> NuGetPushOptions) -> nupkg:string -> unit

Execute dotnet nuget push command

Parameters

  • 'setParams' - set nuget push command parameters
  • 'nupkg' - nupkg to publish

Sample

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
open Fake.DotNet
let setNugetPushParams (defaults:NuGet.NuGetPushParams) =
        { defaults with
            DisableBuffering = true
            ApiKey = Some "abc123"
         }
let setParams (defaults:DotNet.NuGetPushOptions) =
        { defaults with
            PushParams = setNugetPushParams defaults.PushParams
         }

DotNet.nugetPush setParams "./My.Package.nupkg"
namespace Fake
namespace Fake.DotNet
val setNugetPushParams : defaults:'a -> 'a
val defaults : 'a
namespace Fake.DotNet.NuGet
union case Option.Some: Value: 'T -> Option<'T>
val setParams : defaults:DotNet.NuGetPushOptions -> DotNet.NuGetPushOptions
val defaults : DotNet.NuGetPushOptions
module DotNet

from Fake.DotNet
type NuGetPushOptions =
  { Common: Options
    PushParams: NuGetPushParams }
    member WithCommon : common:Options -> NuGetPushOptions
    member WithPushParams : options:NuGetPushParams -> NuGetPushOptions
    static member Create : unit -> NuGetPushOptions
DotNet.NuGetPushOptions.PushParams: NuGet.NuGet.NuGetPushParams
val nugetPush : setParams:(DotNet.NuGetPushOptions -> DotNet.NuGetPushOptions) -> nupkg:string -> unit
DotNet.pack setParams project
Signature: setParams:(PackOptions -> PackOptions) -> project:string -> unit

Execute dotnet pack command

Parameters

  • 'setParams' - set pack command parameters
  • 'project' - project to pack

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let packConfiguration (defaults:DotNet.PackOptions) =
    { defaults with
          Configuration = DotNet.Debug
          OutputPath = Some "./packages"
          IncludeSymbols = true }

DotNet.pack packConfiguration "./MyProject.csproj"
val packConfiguration : defaults:'a -> 'a
val defaults : 'a
union case Option.Some: Value: 'T -> Option<'T>
DotNet.prefixProcess(...)
Signature: buildOptions:(Options -> Options) -> firstArgs:string list -> c:CreateProcess<'a> -> CreateProcess<'a>
Type parameters: 'a

Replace the current CreateProcess instance to run with dotnet.exe

Parameters

  • 'buildOptions' - build common execution options
  • 'firstArg' - the first argument (like t)
  • 'args' - command arguments
DotNet.Preview2ToolingOptions(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use a stable release at this point")>]
OBSOLETE

Please use a stable release at this point

.NET Core SDK install options preconfigured for preview2 tooling

DotNet.publish setParams project
Signature: setParams:(PublishOptions -> PublishOptions) -> project:string -> unit

Execute dotnet publish command

Parameters

  • 'setParams' - set publish command parameters
  • 'project' - project to publish
DotNet.RC4_004771ToolingOptions(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use a stable release at this point")>]
OBSOLETE

Please use a stable release at this point

.NET Core SDK install options preconfigured for preview4 tooling

DotNet.RC4_004973ToolingOptions(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use a stable release at this point")>]
OBSOLETE

Please use a stable release at this point

.NET Core SDK install options preconfigured for preview4 tooling, this is marketized as v1.0.1 release of the .NET Core tools

DotNet.Release_1_0_4(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_1_0_4 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_1_0_4 instead

DotNet.Release_2_0_0(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_2_0_0 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_2_0_0 instead

DotNet.Release_2_0_3(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_2_0_3 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_2_0_3 instead

DotNet.Release_2_1_300(option)
Signature: option:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_2_1_300 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_2_1_300 instead

DotNet.Release_2_1_300_RC1(option)
Signature: option:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_2_1_300_RC1 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_2_1_300_RC1 instead

DotNet.Release_2_1_4(options)
Signature: options:CliInstallOptions -> CliInstallOptions
Attributes:
[<Obsolete("Please use DotNet.Versions.Release_2_1_4 instead")>]
OBSOLETE

Please use DotNet.Versions.Release_2_1_4 instead

DotNet.restore setParams project
Signature: setParams:(RestoreOptions -> RestoreOptions) -> project:string -> unit

Execute dotnet restore command

Parameters

  • 'setParams' - set restore command parameters
  • 'project' - project to restore packages
DotNet.setupEnv(install)
Signature: install:(Options -> Options) -> unit

Setup the environment (PATH and DOTNET_ROOT) in such a way that started processes use the given dotnet SDK installation. This is useful for example when using fable, see https://github.com/fsharp/FAKE/issues/2405

Parameters

  • 'install' - The SDK to use (result of DotNet.install)
DotNet.test setParams project
Signature: setParams:(TestOptions -> TestOptions) -> project:string -> unit

Execute dotnet test command

Parameters

  • 'setParams' - set test command parameters
  • 'project' - project to test
DotNet.tryGetSDKVersionFromGlobalJson()
Signature: unit -> string option

Tries the DotNet SDK from the global.json This file can exist in the working directory or any of the parent directories Returns None if global.json is not found

DotNet.uninstallTemplate(templateName)
Signature: templateName:string -> unit

Execute dotnet new --uninstall command to uninstall a new template

Parameters

  • 'templateName' - template short name to uninstall
  • 'setParams' - set version command parameters