MSBuildSettings Class

Summary

Contains settings used by MSBuildRunner.
Namespace
Cake.Common.Tools.MSBuild
Base Types
graph BT Type-->Base0["ToolSettings"] click Base0 "/api/Cake.Core.Tooling/ToolSettings" Base0-->Base1["object"] Type["MSBuildSettings"] class Type type-node

Syntax

public sealed class MSBuildSettings : ToolSettings

Constructors

Name Summary
MSBuildSettings() Initializes a new instance of the MSBuildSettings class.

Properties

Name Value Summary
ArgumentCustomization Func<ProcessArgumentBuilder, ProcessArgumentBuilder>
Gets or sets the argument customization. Argument customization is a way that lets you add, replace or reuse arguments passed to a tool. This allows you to support new tool arguments, customize arguments or address potential argument issues.
Inherited from ToolSettings
BinaryLogger MSBuildBinaryLogSettings
Gets or sets the binary logging options
Configuration string
Gets or sets the configuration.
ConsoleLoggerParameters ISet<string>
Gets the console logger parameters.
DetailedSummary bool?
Gets or sets whether or not detailed summary is created. Shows detailed information at the end of the build about the configurations built and how they were scheduled to nodes.
EnvironmentVariables IDictionary<string, string>
Gets or sets search paths for files, directories for temporary files, application-specific options, and other similar information.
Inherited from ToolSettings
FileLoggers ICollection<MSBuildFileLogger>
Gets the file loggers
Loggers ICollection<MSBuildLogger>
Gets the loggers.
MaxCpuCount int?
Gets or sets the maximum CPU count. If this value is zero, MSBuild will use as many processes as there are available CPUs to build the project. If not set MSBuild compile projects in this solution one at a time.
MSBuildPlatform MSBuildPlatform
Gets or sets the MSBuild platform.
NoConsoleLogger bool?
Gets or sets whether or not information is logged to the console. Disable the default console logger and do not log events to the console.
NodeReuse bool?
Gets or sets whether or not node reuse is used. When you’re doing multiple builds in a row, this helps reduce your total build time, by avoiding the start up costs of each MSBuild child node.
NoImplicitTarget bool?
Gets or sets a value indicating whether implicit target should be passed to MSBuild. If set to true, no targets will be specified. If set to false, and no targets specified, Build target will be passed by default.
NoLogo bool?
Gets or sets a value indicating whether to show copyright information at the start of the program.
NoWorkingDirectory bool
Gets or sets a value indicating whether or not to opt out of using an explicit working directory for the process.
Inherited from ToolSettings
PlatformTarget PlatformTarget?
Gets or sets the platform target.
Properties IDictionary<string, IList<string>>
Gets the properties.
Restore bool
Gets or sets a value indicating whether the Restore target should be run before any other targets. This setting will pass the /restore option down to MSBuild. Use this setting when working with the new csproj format.
RestoreLockedMode bool?
Gets or sets a value indicating whether or not to lock the package dependency graph while restoring, using the packages.lock.json file. This setting is available with atleast Visual Studio 2017 version 15.9 and above or NET SDK version 2.1.500 and above.
Targets ISet<string>
Gets the targets.
ToolPath FilePath
Gets or sets the tool path.
Inherited from ToolSettings
ToolTimeout TimeSpan?
Gets or sets optional timeout for tool execution.
Inherited from ToolSettings
ToolVersion MSBuildToolVersion
Gets or sets the tool version.
Verbosity Verbosity
Gets or sets the amount of information to display in the build log. Each logger displays events based on the verbosity level that you set for that logger.
WarningsAsError bool
Gets or sets a value indicating whether warnings should be treated as errors. Treats all warnings as errors unless WarningsAsErrorCodes has specific codes specified.
WarningsAsErrorCodes ISet<string>
Gets the warning codes to treat as errors. If any specified will implicitly be treated as true.
WarningsAsMessageCodes ISet<string>
Gets the warning codes to NOT treat as errors.
WorkingDirectory DirectoryPath
Gets or sets the working directory for the tool process.
Inherited from ToolSettings

Extension Methods

Name Value Summary
AddFileLogger() MSBuildSettings
Adds a file logger with all the default settings. Each file logger will be declared in the order added. The first file logger will match up to the /fl parameter. The next nine (max) file loggers will match up to the /fl1 through /fl9 respectively.
AddFileLogger(MSBuildFileLogger) MSBuildSettings
Adds a file logger. Each file logger will be declared in the order added. The first file logger will match up to the /fl parameter. The next nine (max) file loggers will match up to the /fl1 through /fl9 respectively.
Dump<MSBuildSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
EnableBinaryLogger() MSBuildSettings
Enables the binary logger with all the default settings.
EnableBinaryLogger(MSBuildBinaryLogImports) MSBuildSettings
Enables the binary logger with the specified imports and default file name.
EnableBinaryLogger(string) MSBuildSettings
Enables the binary logger with the specified log file name and no imports.
EnableBinaryLogger(string, MSBuildBinaryLogImports) MSBuildSettings
Enables the binary logger with the specified log file name and imports.
IsIn<MSBuildSettings>(MSBuildSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<MSBuildSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<MSBuildSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
SetConfiguration(string) MSBuildSettings
Sets the configuration.
SetDetailedSummary(bool) MSBuildSettings
Sets whether or not detailed summary should be enabled.
SetMaxCpuCount(int?) MSBuildSettings
Sets the maximum CPU count. Without this set MSBuild will compile projects in this solution one at a time.
SetMSBuildPlatform(MSBuildPlatform) MSBuildSettings
Sets the MSBuild platform.
SetNoConsoleLogger(bool) MSBuildSettings
Sets whether or not no console logging should be enabled.
SetNodeReuse(bool) MSBuildSettings
Sets whether or not node reuse should be enabled.
SetNoImplicitTarget(bool) MSBuildSettings
Sets whether or not any targets should be passed to MSBuild.
SetNoLogo(bool) MSBuildSettings
Sets whether or not copyright information at the start of the program should be shown.
SetPlatformTarget(PlatformTarget) MSBuildSettings
Sets the platform target.
SetRestoreLockedMode(bool) MSBuildSettings
Sets whether or not to lock the package dependency graph while restoring, using the packages.lock.json file. This setting is available with atleast Visual Studio 2017 version 15.9 and above or NET SDK version 2.1.500 and above.
SetVerbosity(Verbosity) MSBuildSettings
Sets the build log verbosity.
ThrowIfNull<MSBuildSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<MSBuildSettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
UseToolVersion(MSBuildToolVersion) MSBuildSettings
Sets the tool version.
WithConsoleLoggerParameter(string) MSBuildSettings
Adds a console logger parameter.
WithLogger(string, string, string) MSBuildSettings
Adds a custom logger.
WithProperty(string, string[]) MSBuildSettings
Adds a property to the configuration.
WithRestore() MSBuildSettings
Invoke the Restore target before any other target.
WithTarget(string) MSBuildSettings
Adds a MSBuild target to the configuration.
WithWarningsAsError(string[]) MSBuildSettings
Treat warnings as errors, if no codes specified all errors will be treated as errors.
WithWarningsAsMessage(string[]) MSBuildSettings
Warnings to not treat as errors.