This documentation is archived and is not being maintained.
CommandLineBuilder Class
Visual Studio 2010
Comprises utility methods for constructing a command line.
System::Object
Microsoft.Build.Utilities::CommandLineBuilder
Microsoft.Build.Tasks::CommandLineBuilderExtension
Microsoft.Build.Utilities::CommandLineBuilder
Microsoft.Build.Tasks::CommandLineBuilderExtension
Assembly: Microsoft.Build.Utilities.v4.0 (in Microsoft.Build.Utilities.v4.0.dll)
The CommandLineBuilder type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | CommandLineBuilder() | Initializes a new instance of the CommandLineBuilder class. |
![]() | CommandLineBuilder(Boolean) | Default constructor |
| Name | Description | |
|---|---|---|
![]() | CommandLine | Gets the StringBuilder instance representing the command line for inheriting classes. |
![]() | Length | Represents the length of the command line. |
| Name | Description | |
|---|---|---|
![]() | AppendFileNameIfNotNull(ITaskItem) | Appends the command line with the file name of the specified ITaskItem object. |
![]() | AppendFileNameIfNotNull(String) | Appends the command line with file name represented by the parameter, inserting quotation marks if necessary. |
![]() | AppendFileNamesIfNotNull(array<ITaskItem>, String) | Appends the command line with the list of file names in the specified ITaskItem array, separated by the specified delimiter. |
![]() | AppendFileNamesIfNotNull(array<String>, String) | Appends the command line with the list of file names in the specified string array, separated by the specified delimiter. |
![]() | AppendFileNameWithQuoting | Appends the command line with a file name, and surrounds the file name with quotation marks as necessary. |
![]() | AppendQuotedTextToBuffer | Appends given text to the buffer after first quoting the text if necessary. |
![]() | AppendSpaceIfNotEmpty | Adds a space to the specified string, given the string is not empty. |
![]() | AppendSwitch | Appends the command line with the specified switch. |
![]() | AppendSwitchIfNotNull(String, ITaskItem) | Appends the command line with a switch that takes a task item specification that acts a single string parameter. |
![]() | AppendSwitchIfNotNull(String, String) | Appends the command line with a switch that takes a single string parameter. |
![]() | AppendSwitchIfNotNull(String, array<ITaskItem>, String) | Appends the command line with a switch that takes an array of task item specifications that act as string parameters. |
![]() | AppendSwitchIfNotNull(String, array<String>, String) | Appends the command line with a switch that takes an array of string parameters. |
![]() | AppendSwitchUnquotedIfNotNull(String, ITaskItem) | Appends the command line with a switch that takes a task item specification as a single string parameter, without attempting to encapsulate the switch parameter with quotation marks. |
![]() | AppendSwitchUnquotedIfNotNull(String, String) | Appends the command line with a switch that takes a single string parameter, without attempting to encapsulate the switch parameter with quotation marks. |
![]() | AppendSwitchUnquotedIfNotNull(String, array<ITaskItem>, String) | Appends the command line with a switch that takes an array of task item specifications that act as string parameters, without attempting to encapsulate them with quotation marks. |
![]() | AppendSwitchUnquotedIfNotNull(String, array<String>, String) | Appends the command line with a switch that takes an array of string parameters, without attempting to encapsulate switch parameters with quotation marks. |
![]() | AppendTextUnquoted | Appends the command line with string, without attempting to encapsulate the string with quotation marks. |
![]() | AppendTextWithQuoting | Appends the command line with string, and surrounds the string with quotations marks as necessary. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IsQuotingRequired | Determines whether the specified string parameter should be surrounded with quotation marks because it contains white space. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns the command line as a string. (Overrides Object::ToString().) |
![]() | VerifyThrowNoEmbeddedDoubleQuotes | Returns an error if the command line parameter contains a double-quote (") character. Because double quotes are illegal in command line parameters, this method helps prevent parameter injection attacks. |
The following example creates a ToolTask that runs Ilasm.exe (MSIL Assembler). The CommandLineBuilder, ToolLocationHelper, and TaskLoggingHelper classes are used to generate the information needed to run the task.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
