SmartExec Class

MSBuild Extension Pack

SmartExec Class MSBuild Extension Pack Help 4.0.12.0
Runs a specified program or command without blocking the UI. This is similar to the Exec Task: http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx.

This task is useful when you need to run a long command-line task during the build process.

Inheritance Hierarchy

SystemObject  SystemMarshalByRefObject
    Microsoft.Build.UtilitiesAppDomainIsolatedTask
      MSBuild.ExtensionPackBaseAppDomainIsolatedTask
        MSBuild.ExtensionPack.FrameworkSmartExec

Namespace: MSBuild.ExtensionPack.Framework
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The SmartExec type exposes the following members.

Constructors

  NameDescription
Public methodSmartExec
Top
Properties

  NameDescription
Public propertyCommand
Gets or sets the command(s) to run. These can be system commands, such as attrib, or an executable, such as program.exe, runprogram.bat, or setup.msi. This parameter can contain multiple lines of commands (each command on a new-line). Alternatively, you can place multiple commands in a batch file and run it using this parameter.
Public propertyIgnoreExitCode
Gets or sets a value indicating whether to ignore the command exit code. If true, the task ignores the exit code provided by the executed command. Otherwise, the task returns false if the executed command returns an exit code that does not match SuccessExitCode.
Public propertySuccessExitCode
Gets or sets the success exit code for the command. Default is zero (0).
Top
Examples

<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
    <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
  </PropertyGroup>
  <Import Project="$(TPath)"/>
  <Target Name="Default">
    <MSBuild.ExtensionPack.Framework.SmartExec Command="iisreset.exe"/>
    <MSBuild.ExtensionPack.Framework.SmartExec Command="copy &quot;d:\a\*&quot; &quot;d:\b\&quot; /Y"/>
  </Target>
</Project>
See Also

Reference