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
AllowPreviewVersion bool
Gets or sets a value indicating whether tools from a preview edition of Visual Studio should be used.

If set to true, MSBuildTools from a Preview edition (e.g. Visual Studio 2022 Preview) will be considered to be used.

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
AssemblyVersion string
Gets or sets the assembly version number embedded in the build output.
BinaryLogger MSBuildBinaryLogSettings
Gets or sets the binary logging options.
Configuration string
Gets or sets the configuration.
ConsoleLoggerParameters ISet<string>
Gets the console logger parameters.
ContinuousIntegrationBuild bool?
Gets or sets a value indicating whether to normalize stored file paths used when producing deterministic builds.
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.
FileVersion string
Gets or sets the file version number embedded in the build output.
HandleExitCode Func<int, bool>
Gets or sets whether the exit code from the tool process causes an exception to be thrown.

If the delegate is null (the default) or returns false, then an exception is thrown upon a non-zero exit code.

If the delegate returns true then no exception is thrown.

This can be useful when the exit code should be ignored, or if there is a desire to apply logic that is conditional on the exit code value.

Inherited from ToolSettings
IncludeSymbols bool?
Gets or sets a value indicating whether a symbol package should be created.
InformationalVersion string
Gets or sets the assembly informational version number embedded in the build output.
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
PackageReleaseNotes string
Gets or sets the release notes of the NuGet package generated.
PackageVersion string
Gets or sets the version number of the NuGet package generated.
PlatformTarget PlatformTarget?
Gets or sets the platform target.
PostAction Action<IProcess>
Gets or sets a delegate which is executed after the process was started.
Inherited from ToolSettings
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 at least Visual Studio 2017 version 15.9 and above or NET SDK version 2.1.500 and above.
SetupProcessSettings Action<ProcessSettings>
Gets or sets a delegate to configure the process settings.
Inherited from ToolSettings
SymbolPackageFormat string
Gets or sets the symbol package format.
Target string
Gets or sets the MSBuild target.
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.
Version string
Gets or sets the default value of all the version numbers embedded in the build output.
VersionPrefix string
Gets or sets the base version number embedded in the build output.
VersionSuffix string
Gets or sets the pre-release label of the version number embedded in the build output.
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(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.
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.
Dump<MSBuildSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
EnableBinaryLogger(MSBuildBinaryLogImports) MSBuildSettings
Enables the binary logger with the specified imports and default file name.
EnableBinaryLogger(string, MSBuildBinaryLogImports) MSBuildSettings
Enables the binary logger with the specified log file name and imports.
EnableBinaryLogger(string) MSBuildSettings
Enables the binary logger with the specified log file name and no imports.
EnableBinaryLogger() MSBuildSettings
Enables the binary logger with all the default settings.
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
SetAssemblyVersion(string) MSBuildSettings
Sets the assembly version.
SetConfiguration(string) MSBuildSettings
Sets the configuration.
SetContinuousIntegrationBuild(bool?) MSBuildSettings
Sets a value indicating whether to normalize stored file paths used when producing deterministic builds.
SetDetailedSummary(bool) MSBuildSettings
Sets whether or not detailed summary should be enabled.
SetFileVersion(string) MSBuildSettings
Sets the file version.
SetIncludeSymbols(bool) MSBuildSettings
Sets whether or not a symbol package should be created.
SetInformationalVersion(string) MSBuildSettings
Sets the informational version.
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.
SetPackageReleaseNotes(string) MSBuildSettings
Sets the package release notes.
SetPackageVersion(string) MSBuildSettings
Sets the package version.
SetPlatformTarget(PlatformTarget) MSBuildSettings
Sets the platform target.
SetPlatformTarget(string) 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.
SetSymbolPackageFormat(string) MSBuildSettings
Sets the symbol package format.
SetVerbosity(Verbosity) MSBuildSettings
Sets the build log verbosity.
SetVersion(string) MSBuildSettings
Sets the version.
SetVersionPrefix(string) MSBuildSettings
Sets the version prefix.
SetVersionSuffix(string) MSBuildSettings
Sets the version suffix.
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
ThrowIfNull<MSBuildSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
UseToolVersion(MSBuildToolVersion) MSBuildSettings
Sets the tool version.
UseToolVersion(string) MSBuildSettings
Sets the tool version.
WithArgumentCustomization<MSBuildSettings>(Func<ProcessArgumentBuilder, ProcessArgumentBuilder>) T
Sets the tool argument customization delegate.
WithConsoleLoggerParameter(string) MSBuildSettings
Adds a console logger parameter.
WithEnvironmentVariable<MSBuildSettings>(string, string) T
Sets or adds tool environment variable.
WithExpectedExitCode<MSBuildSettings>(int) T
Sets expected exit code using WithHandleExitCode<T>(T, Func<int, bool>).
WithHandleExitCode<MSBuildSettings>(Func<int, bool>) T
Sets delegate whether the exit code from the tool process causes an exception to be thrown.
WithLogger(string, string, string) MSBuildSettings
Adds a custom logger.
WithNoWorkingDirectory<MSBuildSettings>(bool) T
Sets whether the tool should use a working directory or not.
WithPostAction<MSBuildSettings>(Action<IProcess>) T
Sets a delegate which is executed after the tool process was started.
WithProperty(string, string[]) MSBuildSettings
Adds a property to the configuration.
WithRestore() MSBuildSettings
Invoke the Restore target before any other target.
WithSetupProcessSettings<MSBuildSettings>(Action<ProcessSettings>) T
Sets a delegate to configure the process settings.
WithTarget(string) MSBuildSettings
Adds a MSBuild target to the configuration.
WithToolPath<MSBuildSettings>(FilePath) T
Sets the tool path.
WithToolSettings<MSBuildSettings>(Action<MSBuildSettings>) T
Provides fluent null guarded tool settings action.
WithToolTimeout<MSBuildSettings>(TimeSpan) T
Sets the tool timeout.
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.
WithWorkingDirectory<MSBuildSettings>(DirectoryPath) T
Sets the tool working directory.