Solved

always clean before build or rebuild

Posted on 2015-01-13
7
460 Views
Last Modified: 2015-01-15
I'm running VIsual Studio 2010, debugging an older bit of code.

Is there a way to always have the Solution do a "Clean" before a "Build" automatically?

-update:

During my own research, apparently "Rebuild" is supposed to do a "Clean + Build" ... but is it possible that the "clean" is not being as effective when done in in this manner, vs doing a Clean THEN a Rebuild (or Build) as separate steps?

Anyway - my questions stands .. is there a way to do a "Clean" then a "Rebuild" in an automated fashion...assuming just doing a "Rebuild" is not enough for some strange reason?

-another update:

The whole reason for this is when I do a "Rebuild" some of my references no longer "link up" as they used to for one of my projects when I try to open a window inside the application.  However, if I close the window, do a Clean THEN a Rebuild, then go back and try and open the window -- it works.
0
Comment
Question by:knowlton
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 40547644
If your project dependencies are complete, a rebuild performs the same cleanup as a manual clean.
0
 
LVL 9

Assisted Solution

by:sudheeshthegreat
sudheeshthegreat earned 100 total points
ID: 40548038
It seems some of your projects have broken references. For instance, if a project refers to a dll file from a bin\Debug folder, the solution build would give different results on compilation based on if the dll file is already present in that output folder.

Performing a Rebuild everytime is really a waste of time. The better approach would be to inspect all your project files (with the .csproj or .vbproj extension) with a text editor and ensure that all the references are correct. Just make sure that you do not add references from under a bin folder.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40548040
Performing a Rebuild everytime is really a waste of time.
That's a matter of opinion, I think. It doesn't really take that much more time than a Build, and I've run into issues where dependencies weren't built correctly and then led to build errors if I used Build. Rebuild is my default action for nearly every compile.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 5

Author Comment

by:knowlton
ID: 40548057
From my original post (second update note):

The whole reason for this is when I do a "Rebuild" some of my references no longer "link up" as they used to for one of my projects when I try to open a window inside the application.  However, if I close the window, do a Clean THEN a Rebuild, then go back and try and open the window -- it works.

What exactly explains this behavior and what solves it?

And for a temporary work-around .. can I some how rig some automation (macro?) in Visual Studio 2010 to do a CLEAN then a REBUILD, in that order?  I've not done much with build automation / scripting.  How much support is there for it?
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 100 total points
ID: 40548079
AFAIK, Visual Studio has never had macros--even though I'm sure it's a popular request. The closest thing I can think of would be to rebind some of your keys to each operation. For example, I rebind F7 to Rebuild. You could rebind F6 to Clean and F7 to Rebuild. It's two key presses at that point, but it may be a tad quicker than what you currently do.
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 300 total points
ID: 40548631
Macros have been removed from VS with 2008 (IIRC), but you can get them back with VCmd: http://vlasovstudio.com/visual-commander/
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 40552319
Thanks everyone.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.net Fit 3 divs on screen side by side 3 28
ASP.NET MVC 2 31
Need help with building query string 2 19
Function after success of Jquery/AJAX action 9 17
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question