[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

always clean before build or rebuild

Posted on 2015-01-13
7
Medium Priority
?
769 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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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