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

MSBuild

Nested types and modules

TypeDescription
CliArguments

A type for MSBuild task parameters

Functions and values

Function or valueDescription
MSBuild.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
    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
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
MSBuild.buildArgs(setParams)
Signature: setParams:(MSBuildParams -> MSBuildParams) -> MSBuildParams * string
MSBuild.buildWebsite(...)
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.
MSBuild.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.
MSBuild.buildWebsites(...)
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.
MSBuild.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.
MSBuild.msBuildExe
Signature: string
Attributes:
[<Obsolete("Implementation detail.")>]
OBSOLETE

Implementation detail.

MSBuild.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.
MSBuild.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.
MSBuild.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.
MSBuild.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.
MSBuild.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.
MSBuild.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.