I am cleaning up a bunch of visual studio projects / solutions from different sources, and there are an incredible amount of temporary files and temporary folders stored in each solution.
I am wondering what file types are safe to delete so that I can write a script to take care of the heavy lifting so there is less junk to push around when I am trying to get the whole folder structure organized and linked up to the proper shared file locations.
As far as I can see the following files and folders are temporary and can be safely deleted:
Files
Folders
I am not even sure what some of these file types really are, I just know they are re-generated when you open the solution - and I know there are many more file types that I have missed from older and newer versions of Visual Studio.
Are there any file types that should be preserved in the list above? If so, for what reason, and are there further file types that can be cleaned out without any serious side effects?
The overall idea is to minimize the size and complexity of the solution when it is to be migrated, moved or reorganized or otherwise shuffled around enough for this "solution fat" to be a serious performance and management problem.
Typically I see this problem if I need to check something into a new source control system, zip and send sample code by email or put third party or peer code into an existing hierarchy of shared folders and files.
I disagree with your list of "temporary" files - certainly very few of them are temporary in nature (otherwise they'd be in the %TEMP% directory). Granted, most of them are not necessary for your project to build successfully, but they are still important.
I've no idea what this or the other files are: .opt, .plg, .aps, .clw
Of course, the trick is to properly arrange your files in your solution in the first place. Project source files should be kept separate from project metadata (i.e. the files I just listed above), ideally in separate folders in their own heirarchy (that way you can have multiple VC project files for the same source code, allowing contributors to use VC2005, 2008, and 2010 at the same time).
Have a look at the folders and extensions listed in the answers to this Visual Studio .gitignore question for an idea of the files that are commonly considered non-essential.
However, it is generally speaking not a good idea to delete stuff if you don't know what it is. For example, .sdf files may be SQL Server CE databases, which might be important in some projects. So make sure you make a backup somewhere before running any solution cleaner scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With