INFO

This API documentation is for FAKE version 5.0 or later. The old API documentation can be found here for migration or here for fake 4

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

MSBuild

Functions and values

Function or valueDescription
build(setParams project)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> project:string -> unit

Runs a MSBuild project

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • 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: 
open Fake.DotNet
let buildMode = Environment.environVarOrDefault "buildMode" "Release"
let setParams (defaults:MSBuildParams) =
        { defaults with
            Verbosity = Some(Quiet)
            Targets = ["Build"]
            Properties =
                [
                    "Optimize", "True"
                    "DebugSymbols", "True"
                    "Configuration", buildMode
                ]
         }
MSBuild.build setParams "./MySolution.sln"
namespace Fake
namespace Fake.DotNet
val buildMode : string
val setParams : defaults:MSBuildParams -> MSBuildParams
val defaults : MSBuildParams
type MSBuildParams =
  {ToolPath: string;
   Targets: string list;
   Properties: (string * string) list;
   MaxCpuCount: int option option;
   NoLogo: bool;
   NodeReuse: bool;
   RestorePackagesFlag: bool;
   ToolsVersion: string option;
   Verbosity: MSBuildVerbosity option;
   NoConsoleLogger: bool;
   ...}
    member WithEnvironment : map:Map<string,string> -> MSBuildParams
    static member Create : unit -> MSBuildParams
union case Option.Some: Value: 'T -> Option<'T>
union case MSBuildVerbosity.Quiet: MSBuildVerbosity
module MSBuild

from Fake.DotNet
val build : setParams:(MSBuildParams -> MSBuildParams) -> project:string -> unit
buildWebsite(outputPath projectFile)
Signature: outputPath:string -> projectFile:string -> unit

Builds the given web project file with debug configuration and copies it to the given outputPath.

Parameters

  • outputPath - The output path.
  • projectFile - The project file path.
buildWebsiteConfig(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> configuration:string -> projectFile:string -> unit

Builds the given web project file in the specified configuration and copies it to the given outputPath.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - The output path.
  • configuration - MSBuild configuration.
  • projectFile - The project file path.
buildWebsites(outputPath projectFiles)
Signature: outputPath:(MSBuildParams -> MSBuildParams) -> projectFiles:string -> seq<string> -> unit

Builds the given web project files with debug configuration and copies them to the given websiteDir.

Parameters

  • outputPath - The output path.
  • projectFiles - The project file paths.
buildWebsitesConfig(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> configuration:string -> projectFiles:seq<string> -> unit

Builds the given web project files in specified configuration and copies them to the given outputPath.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - The output path.
  • configuration - MSBuild configuration.
  • projectFiles - The project file paths.
msBuildExe
Signature: string
run(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> targets:string -> properties:(string * string) list -> projects:seq<string> -> string list

Builds the given project files or solution files and collects the output files.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - If it is null or empty then the project settings are used.
  • targets - A string with the target names which should be run by MSBuild.
  • properties - A list with tuples of property name and property values.
  • projects - A list of project or solution files.
runDebug(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> targets:string -> projects:seq<string> -> string list

Builds the given project files or solution files and collects the output files.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - If it is null or empty then the project settings are used.
  • targets - A string with the target names which should be run by MSBuild.
  • projects - A list of project or solution files.
runRelease(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> targets:string -> projects:seq<string> -> string list

Builds the given project files or solution files and collects the output files.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - If it is null or empty then the project settings are used.
  • targets - A string with the target names which should be run by MSBuild.
  • projects - A list of project or solution files.
runReleaseExt(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> properties:(string * string) list -> targets:string -> projects:seq<string> -> string list

Builds the given project files or solution files in release mode and collects the output files.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - If it is null or empty then the project settings are used.
  • properties - A list with tuples of property name and property values.
  • targets - A string with the target names which should be run by MSBuild.
  • projects - A list of project or solution files.
runWithDefaults(targets projects)
Signature: targets:string -> projects:seq<string> -> string list

Builds the given project files or solution files in release mode to the default outputs.

Parameters

  • targets - A string with the target names which should be run by MSBuild.
  • projects - A list of project or solution files.
runWithProperties(...)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> outputPath:string -> targets:string -> properties:(string -> (string * string) list) -> projects:seq<string> -> string list

Builds the given project files and collects the output files.

Parameters

  • setParams - A function that overwrites the default MSBuildParams
  • outputPath - If it is null or empty then the project settings are used.
  • targets - A string with the target names which should be run by MSBuild.
  • properties - A list with tuples of property name and property values.
  • projects - A list of project or solution files.