A simple CLI tool for cleaning up your .NET project folders. Quickly delete bin and obj folders with safety as files only get deleted when .csproj or .sln file presents in the folder.
The tool requires .NET 6.0 or up. You can download it here.
Install the CLI globally from Nuget:
dotnettoolinstall-gNetCleanerTo make sure the tool is up-to-date, run this command:
dotnettoolupdate-gNetCleaner--no-cacheAfter that you can try running netclean --help or netclean --version to ensure the tool was installed.
Run netclean -h to list all supported parameters.
By default, the tool runs in WhatIf mode and no file are actually deleted. When you are sure the files/folders are good to be deleted, run with -d or --Delete.
For example, netclean -r "TestCleaner" -s would search all obj and bin folders/files inside TestCleaner folder (relative to current directory) as well as report the size of these folders/files.
Running netclean -r "TestCleaner" -s -d would actually delete the folders/files.
-d,--DeleteActuallydeletethefolders.Default:false.-n,--NamesFolderandFilenamesincomma-separatedlistthatshouldbedeleted.NOTcase-sensitive.Default:bin,obj-e,--ExtensionsFileextensionsthatisrequiredtoexistinordertodeletefolders.NOTcase-sensitive.Ifnoneisspecified,filesandfolderswillbedeleted.Default:sln,csproj,wapproj-s,--SizeReporttotalfilesizeofdeletedfolders-r,--RootStartfolderwherethesearchisperformed.DefaulttoCurrentDirectory.-i,--IgnoresIgnorethesefoldernamesinthiscomma-separatedlist.NOTcase-sensitive.Default:(nothing)--helpDisplaythishelpscreen.--versionDisplayversioninformation.
