My understanding is that Rebuild = Clean + Build. What are the likeliest reasons for offering ‘Clean Solution’ as a separate option, since rebuild does the same thing? I gave it some thought, and the only reason I could come up with was that some solutions can be fairly large and it may be time-consuming to do a clean AND a rebuild, but if you do a clean you'd have to (re)build anyway, right? Thanks, and happy holidays to all.
Choose Clean Solution to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.
To build, rebuild, or clean an entire solution Choose Build All to compile the files and components within the project that have changed since the most recent build. Choose Rebuild All to "clean" the solution and then builds all project files and components. Choose Clean All to delete any intermediate and output files.
With your project open in Visual Studio, choose Build menu > Clean Solution. This removes all compiled assemblies (.exe, . dll files) and object (. obj) files from your projects, but does not remove the debugging files.
Build solution: Compiles code files (DLL and EXE) which are changed. Rebuild: Deletes all compiled files and compiles them again irrespective if the code has changed or not. Clean solution: Deletes all compiled files (DLL and EXE file).
Clean Solution is like msbuild /t:clean
and make clean
, so it's useful in the same situations.
Your build is a little broken, such that a generated file is placed in a common directory. When you switch configurations, you first clean the old configuration and then build the new one.
You want to send someone a copy of your solution
You don't have source control, but you want to checkpoint your solution before continuing
You are modifying your project files by hand and want to make sure they work properly
You created a new solution, worked on it for a day, and are now ready to put it in source control. Before you "add all files", you want to remove the generated files.
You are short on disk space, and want to discard unnecessary files. Suppose you have a small SSD and several large solutions, or if you want to change configurations.
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