Solved

always clean before build or rebuild

Posted on 2015-01-13
7
428 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 68

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 68

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Duplicate a row 2 46
Auto refresh part of an MVC5 View 7 57
Name space syntax error 12 41
Server Error 11 47
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now