Solved

always clean before build or rebuild

Posted on 2015-01-13
7
394 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 74

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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 74

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

12 Experts available now in Live!

Get 1:1 Help Now