Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

always clean before build or rebuild

Posted on 2015-01-13
7
Medium Priority
?
716 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 71

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 400 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:Tom 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 400 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 71

Accepted Solution

by:
Qlemo earned 1200 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:Tom Knowlton
ID: 40552319
Thanks everyone.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

618 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