tags:

views:

38

answers:

1

Vs2010 .net 4.0 targeted project if that affects the answers at all.

I want to delete the bin and obj directories and output a message for the path of what was deleted.

<Target Name="CleanOutputs" Condition="'$(MvcBuildViews)'=='true'">
    <Message Text="Cleaning Outputs" Importance="high"/>
    <RemoveDir Directories="$(OutputPath);obj" RemovedDirectories="@(removed)" />
    <Message Text="Removed: %(removed.FullPath)" Importance="high"/>
    <Message Text=" "/>
    <!--<RemoveDir Directories="obj" />-->
    <MakeDir Condition="!Exists('$(OutputPath)')" Directories="$(OutputPath)" />
</Target>

Is what I have, but the Removed: message never shows.

+3  A: 

Your syntax for getting the removed directories isn't right. There is the good one :

<Target Name="CleanOutputs" Condition="'$(MvcBuildViews)'=='true'">
    <Message Text="Cleaning Outputs" Importance="high"/>

    <RemoveDir Directories="$(OutputPath);obj">
      <Output TaskParameter="RemovedDirectories" ItemName="removed"/>
    </RemoveDir>
    <Message Text="Removed: %(removed.FullPath)" Importance="high"/>

    <Message Text=" "/>
    <!--<RemoveDir Directories="obj" />-->
    <MakeDir Condition="!Exists('$(OutputPath)')" Directories="$(OutputPath)" />
</Target>
madgnome