SmartExec ClassMSBuild Extension Pack Help
Runs a specified program or command without blocking the UI. This is similar to the Exec Task:

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

Inheritance Hierarchy


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

The SmartExec type exposes the following members.


Public methodSmartExec

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

<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="">
    <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
  <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"/>
See Also