Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Last active February 27, 2024 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peteraritchie/c32008d0c20323126c908a61ef9991d6 to your computer and use it in GitHub Desktop.
Save peteraritchie/c32008d0c20323126c908a61ef9991d6 to your computer and use it in GitHub Desktop.
A Directory.build.props file that cleans the `obj` and `bin` directories when executing `dotnet clean` or the clean operation in Visual Studio. Find latest version here: https://gist.githubusercontent.com/peteraritchie/c32008d0c20323126c908a61ef9991d6/raw/Directory.build.props
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
</PropertyGroup>
<Target Name="PostClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
<RemoveDir Directories="$(BaseOutputPath)" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment