I'm trying to write a MSBuild Task that deletes the Obj directory and PDBs from my bin folder on my production build scripts and can't seem to get it to work right.
Does anyone have an example where they do this or similar, or a link to a simple example of removing files and a directory with MSBuild?
You can delete the files in those directories first and then the dir itself with
<Target Name="SomeTarget">
<ItemGroup>
<FilesToDelete Include="Path\To\Obj\**\*"/>
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<RemoveDir Directories="Path\To\Obj\" />
</Target>