Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scenarios for Visual Studio's ‘Clean Solution’ Option

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.

like image 883
Phil Alegret Avatar asked Dec 24 '09 16:12

Phil Alegret


People also ask

What is the purpose of clean solution in Visual Studio?

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.

How do I run a clean solution in Visual Studio?

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.

How do I clean up Visual Studio 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.

What is the difference between build rebuild and clean?

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).


1 Answers

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.

like image 135
Jay Bazuzi Avatar answered Oct 11 '22 18:10

Jay Bazuzi