Visual Studio (2008) 'Clean Solution' Option

Visual StudioVisual Studio-2008

Visual Studio Problem Overview


What does this option do? It is accessible from the Build menu.

Visual Studio Solutions


Solution 1 - Visual Studio

It deletes all the compiled and temporary files associated with a solution. It ensures that the next build is a full one, rather than only changed files being recompiled.

Solution 2 - Visual Studio

It deletes all the object code generated during previous compilation/build. It deletes all below kind of files:-

*.obj - object code

*.pdb - program debug databse file

*.bsc - source browser databse

*.ilk - incremental linker file

*.sbr - source browser intermediate file

*.idb - rebuild dependency file

*.lib - library file

*.exe - executable

JFYI - Even a Rebuild All command will do all this and then go on to build the complete set of source files.

-AD

Solution 3 - Visual Studio

I wanted this to be a comment but apparently need 50 rep.

To warn others, I find the rebuild solution doesn't do a clean myself. I'll often not I need to clean it and build/rebuild it after for it to work - I think rebuild it's self forces a full compile without clean and overrides everything, but does not get rid of the extras.

Did not look into what rebuild does code wise, just a general observation in case someone else has the same issue.

Solution 4 - Visual Studio

This is an old post, but I thought this was worth mentioning. When coding for Silverlight, I usually have Blend and VS2010 open at the same time. Because of that, sometimes VS2010 freaks out and IntelliSense can't find where stuff is or something, resulting in it falsely highlighting a lot of errors.

Cleaning the solution fixes this.

Solution 5 - Visual Studio

Erases files created during compilation process. Effectively forces a full recompile/build next time.

Solution 6 - Visual Studio

careful when you are cleaning a solution; when you do clean a solution and if you reference to a library (say nhibernate) in your project and if that library has a dependency ( say iesi.collections) , then you'll see iesi.collections will be deleted even if you rebuilt the solution and you have to put that dll to your folder, again. or you can also reference to iesi.collections and choose copy-local : yes option from its properties

Solution 7 - Visual Studio

FYI, neither Clean nor Rebuild will delete non-build files, eg files copied during a pre-build command. I had been confused about that!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJulius AView Question on Stackoverflow
Solution 1 - Visual StudioDavid ArnoView Answer on Stackoverflow
Solution 2 - Visual StudiogoldenmeanView Answer on Stackoverflow
Solution 3 - Visual StudioCharlesView Answer on Stackoverflow
Solution 4 - Visual StudiolordcheetoView Answer on Stackoverflow
Solution 5 - Visual StudioBrian KnoblauchView Answer on Stackoverflow
Solution 6 - Visual StudioersanbilikView Answer on Stackoverflow
Solution 7 - Visual StudioAnneTheAgileView Answer on Stackoverflow