![]() ![]() This is all the code you need to attach to the button: Imports System.IO.Compression So you just grab a simple Forms app from the templates (if you don't already have a housekeeping app) and add a button to it and then ClickOnce install it to your desktop without worrying about special settings or much of anything. Just an addendum to all the fine answers above in case someone doesn't realize how easy it is in VB/C# to automate the entire process down to the zip archive. String dirNames = Directory.GetDirectories(rootDir, "*.*", SearchOption.AllDirectories) įiles.AddRange(Directory.GetFiles(dir, "*.suo")) įiles.AddRange(Directory.GetFiles(dir, "*.user")) Ĭonsole.Write("Deleting directories or directories couldn't be removed", errorsList.Count) Read all the folder names in the specified directory tree Public static void Process(string rootDir) / Based on code of VSProjCleaner tool (C) 2005 Francesco Balena, Code Archirects VisualStudio does, and reports success too).īased on Joe answer, I've converted the VB code into C# : /// ![]() Then run it when you want a proper clean (not the micky mouse one that NOTE : You should have this stored in a PowerShell file and place thatįile at the root of your solution (where the. Messes up and there’s something that a Clean or Rebuild inside the IDEįor those of you reading that may not know, PowerShell supportsĬommand aliases, here it is rewritten again not using the aliases Get-ChildItem -inc bin,obj -rec | Remove-Item -rec -force Workspace directory to get to a “clean” state, especially when someone That wipes out all of the “bin” and “obj” directories in the currentĭirectory and every subdirectory. Here is William's version gci -inc bin,obj -rec | rm -rec -force It should be possible to run it from the root of the drive. This site: uses William Kempf's powershell commands to remove any bin and obj folders from the current directory and sub directories. This way you can enrich or fine-tune your extra-cleanup-logic centrally, in one place without going through the pains of manually editing each and every *.csproj file by hand every time you want to make an improvement. If you are into optimizing the maintainability of your solutions you might want to take things one step further and place the above snippet into a separate file like so: Īnd then include this file at the very end of each and every one of your *.csproj files like so: I have it enabled because I noticed that in some third party projects it causes issues when files ala nfig exist inside the. You may want to comment out the associated line if you feel that removing the. vs folder from the root directory of your solution. Notice that this snippet also wipes out the. If you vote this answer be sure to vote them both as well.įor Visual Studio 2015 the MSBuild variables have changed a bit: ![]() He also provides a good suggestion on making the task easier to deploy and maintain if you have multiple projects to push this into. vs deletion as this would be better served in a. Edit again with parts from xDisruptor but I removed the. Slight evolution based on Shaman's answer below (share the votes and give him some too) Which will remove everything in your bin folder of the current platform/configuration. *proj by adding this somewhere near the end : You can circumvent this problem with a simple change to your. If you have some customizations in your MSBuild project this could spell trouble and leave behind stuff you would think it should have deleted. But it will leave behind everything else. As others have responded already Clean will remove all artifacts that are generated by the build. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |