Share via


RemoveDir 任务

更新:2007 年 11 月

移除指定的目录及其所有文件和子目录。

参数

下表描述了 RemoveDir 任务的参数。

参数

说明

Directories

必选的 ITaskItem[] 参数。

指定要删除的目录。

RemovedDirectories

可选的 ITaskItem[] 输出参数。

包含已成功删除的目录。

示例

下面的示例移除 OutputDirectory 和 DebugDirectory 属性指定的目录。这些路径被作为相对于项目目录的路径来处理。

<Project xmlns="https://schemas.microsoft.com/developer/msbuild/2005">

    <PropertyGroup>
        <OutputDirectory>\Output\</OutputDirectory>
        <DebugDirectory>\Debug\</DebugDirectory>
    </PropertyGroup>

    <Target Name="RemoveDirectories">
        <RemoveDir
            Directories="$(OutputDirectory);$(DebugDirectory)" />
    </Target>

</Project>

请参见

概念

MSBuild 任务

其他资源

MSBuild 任务参考