why are ALL of our projects rebuilt during a solution build?Our solutions typically have many large projects, and often only one or two of them will change during that iteration of development.  Each time we rebuild the solution to deploy and debug (which we do constantly throughout the day), we notice that it seems to rebuild every project every time.  At least, in the output window, that's what we see reported (18 succeeded, 0 failed, 0 skipped).<br><br>How can I find out if (or why) Visual Studio thinks it needs to reprocess or rebuild each project?  Is there a specific target or task name I can search for in the Output window?  It looks like the &quot;csc.exe&quot; task is run on all projects, regardless of the fact that no changes were made in those projects, and we're concerned about the amount of tie we waste during build cycles.  <br><br>We'd like to simply use previously build assemblies if no code or project changes have been made.<br><br>Dan<br>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z59812f3a-8d06-4ace-aef3-9920a699d3edhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#59812f3a-8d06-4ace-aef3-9920a699d3edhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#59812f3a-8d06-4ace-aef3-9920a699d3eddvboomhttp://social.msdn.microsoft.com/Profile/en-US/?user=dvboomwhy are ALL of our projects rebuilt during a solution build?Our solutions typically have many large projects, and often only one or two of them will change during that iteration of development.  Each time we rebuild the solution to deploy and debug (which we do constantly throughout the day), we notice that it seems to rebuild every project every time.  At least, in the output window, that's what we see reported (18 succeeded, 0 failed, 0 skipped).<br><br>How can I find out if (or why) Visual Studio thinks it needs to reprocess or rebuild each project?  Is there a specific target or task name I can search for in the Output window?  It looks like the &quot;csc.exe&quot; task is run on all projects, regardless of the fact that no changes were made in those projects, and we're concerned about the amount of tie we waste during build cycles.  <br><br>We'd like to simply use previously build assemblies if no code or project changes have been made.<br><br>Dan<br>Fri, 21 Sep 2007 17:20:41 Z2007-09-27T09:38:58Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#8492eb2f-36eb-4986-bab2-c81552ffc482http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#8492eb2f-36eb-4986-bab2-c81552ffc482Frank Boynehttp://social.msdn.microsoft.com/Profile/en-US/?user=Frank%20Boynewhy are ALL of our projects rebuilt during a solution build?<p>It isn't clear if you are using the word 'rebuild' in the ordinary English language sense of &quot;build something that has been built before&quot; or if you really mean the Visual Studio &quot;Rebuild Solution&quot; menu selection (or command line switch).</p> <p align=left> </p> <p align=left>If you mean the latter then the reason Visual Studio builds every project every time is that the &quot;Rebuild Solution&quot; command means &quot;clean the solution and then build every project and component in it&quot;.  </p> <p align=left> </p> <p align=left>If you want to only build those projects that have changed since the last build then you want to use the Visual Studio &quot;Build Solution&quot; menu selection (or command line switch) not Rebuild</p> <p align=left><font face=Arial size=2></font> </p>Fri, 21 Sep 2007 18:01:35 Z2007-09-21T18:01:35Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#20909605-ae03-45ad-9630-5907839934f4http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#20909605-ae03-45ad-9630-5907839934f4DanMoseley - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=DanMoseley%20-%20MSFTwhy are ALL of our projects rebuilt during a solution build?<p align=left><font face=Arial size=2>Change the output verbosity to detailed or diagnostic to see why we chose to run csc.exe again. Instructions to do this are at the top of the forum in the 'how to file a bug' posting.</font></p> <p align=left>Dan</p>Sat, 22 Sep 2007 16:27:08 Z2007-09-22T16:27:08Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#3a8a9500-313a-4a22-bbd7-37a531ba2a58http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#3a8a9500-313a-4a22-bbd7-37a531ba2a58dvboomhttp://social.msdn.microsoft.com/Profile/en-US/?user=dvboomwhy are ALL of our projects rebuilt during a solution build?Ah, right, I forgot the difference between these, since Build never works for me.  I get errors because projects that need to be rebuilt are not.  (I have shared files between CF and non-CF projects, which I think is the cause of this.)<br><br>After a complete rebuild, I hit the play button (F5) and it still rebuilds everything again anyway, even though I just did it.  So F5 must issue a Rebuild command.  Too bad it's not smart enough to skip over this.<br>Tue, 25 Sep 2007 17:24:07 Z2007-09-25T17:24:07Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#5879b67a-9422-4113-86b4-8c81cdbc7191http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#5879b67a-9422-4113-86b4-8c81cdbc7191Frank Boynehttp://social.msdn.microsoft.com/Profile/en-US/?user=Frank%20Boynewhy are ALL of our projects rebuilt during a solution build?<p>If build never works for you then I suspect you have some fundamental problem that is messing up Build and also causing all your projects to be rebuilt when you don;t expet them to be.</p> <p align=left> </p> <p align=left>If projects that need to be rebuilt aren't that would suggest either that a dependency is wrong -- project A isn't built because the solution doesn't think project B depends on A so buildng A isn't necessary to build B -- or else some of your project inputs are wrong -- project A isn't built after file X changes because file X isn't recognised as an input to project A so changes to X aren't recognised as affecting A.</p> <p align=left> </p> <p align=left>You should be able to explore this further by examining the contents of the build output window and any build logs produced.  If project A is built, there should be a mention of it in the build output window.  If the build of project A is skipped becaus ethe project is considered up-to-date already then there should be a skipped indication in the build output window.  If there's no mention of project A at all, that would tend to indicate the solution didn't even try to build the project, either because the Solution Configuration doesn't specify A should be built or because of a dependency problem.</p> <p align=left> </p> <p align=left>I'm fairly sure F5 does a build not a rebuild.  Again, the build output window will tell you.  It uses &quot;Build&quot; or &quot;Rebuild&quot; to indicate what it is doing to a project.</p> <p align=left><font face=Arial size=2></font> </p>Tue, 25 Sep 2007 18:59:07 Z2007-09-27T09:38:58Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#48b148d4-17a6-482f-b68e-6509502613echttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#48b148d4-17a6-482f-b68e-6509502613ecDanMoseley - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=DanMoseley%20-%20MSFTwhy are ALL of our projects rebuilt during a solution build?<p align=left>Yes, F5 does a build, not a rebuild.</p> <p align=left> </p> <p align=left>Great posting Frank, thanks</p> <p align=left> </p> <p align=left>Dan</p>Thu, 27 Sep 2007 16:02:22 Z2007-09-27T16:02:22Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#d66ac26c-d0c9-4985-8636-fdbea64104eehttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#d66ac26c-d0c9-4985-8636-fdbea64104eedvboomhttp://social.msdn.microsoft.com/Profile/en-US/?user=dvboomwhy are ALL of our projects rebuilt during a solution build?Even when a project doesn't &quot;build&quot;, there seems to be a good deal of processing for that project anyway.  Now that I'm using Visual Studio 2008, no processing for a project seems to occur AT ALL when I build if there are no changes.  No time is consumed on unchanged projects.  And if no projects have been updated when I hit F5, it starts deploying immediately.<br><br>This is good.<br>Mon, 26 Nov 2007 19:21:03 Z2007-11-26T19:21:03Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#a3fcabf3-3315-4b9f-b32c-110f6a6ce4cbhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#a3fcabf3-3315-4b9f-b32c-110f6a6ce4cbDanMoseley - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=DanMoseley%20-%20MSFTwhy are ALL of our projects rebuilt during a solution build?Yes, for perf we changed to do a much abbreviated 'up to date check' when you hit F5 that does not involve calling MSBuild. When you hit 'Build' (ie., regular, incremental build) we do the thorough up to date check calling into MSBuild. Which of course ought to itself be faster; but meantime <font face=Arial size=2>users of VS2008 should see significantly faster F5 in VB and C# projects.</font> <p align=left> </p> <p align=left>Glad you're happy</p> <p align=left>Dan</p>Tue, 27 Nov 2007 00:19:14 Z2007-11-27T00:19:14Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#ea1501d8-0634-42e3-b5c0-99c724722a3ahttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#ea1501d8-0634-42e3-b5c0-99c724722a3advboomhttp://social.msdn.microsoft.com/Profile/en-US/?user=dvboomwhy are ALL of our projects rebuilt during a solution build?How many different entry points to MSBuild are there from Visual Studio?<br><br><span style="font-weight:bold">F5</span> - build solution if necessary and run/debug<br><span style="font-weight:bold">Build Project</span> - checks to see if the project has been updated, and builds if it has<br><span style="font-weight:bold">Build Solution</span> - checks each project, only building those that have been updated, and also builds any projects with references to rebuilt projects<br><span style="font-weight:bold">Rebuild Solution</span> - force a rebuild of all projects<br><br>I assume that project properties as well as code changes will flag a project as &quot;needing a rebuild&quot;.  Are these the only changes that do so?<br><br>Do I have this right?  Because if so, then I think I'm seeing incorrect behavior for <span style="font-weight:bold">Build Solution</span> for my solutions, as projects that haven't changed--and don't depend on a project that has--are being rebuilt.<br><br>Wed, 28 Nov 2007 15:17:58 Z2007-11-28T15:17:58Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#49b3529b-1174-41c4-b820-b47ecf0d2c54http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#49b3529b-1174-41c4-b820-b47ecf0d2c54Thomas Ardalhttp://social.msdn.microsoft.com/Profile/en-US/?user=Thomas%20Ardalwhy are ALL of our projects rebuilt during a solution build?Just a quick comment about seeing what the build actually does. You can use the MSBuild Profiler to see exactly which projects, targets and tasks that are executed.<br><br>You will find the MSBuild Profiler here: http://www.codeplex.com/msbuildprofiler<br><br>Regards,<br>Thomas Ardal<br>Wed, 28 Nov 2007 16:35:09 Z2007-11-28T16:35:09Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#13739501-3e73-469b-8bb8-74178a5db485http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/59812f3a-8d06-4ace-aef3-9920a699d3ed#13739501-3e73-469b-8bb8-74178a5db485DanMoseley - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=DanMoseley%20-%20MSFTwhy are ALL of our projects rebuilt during a solution build?<p align=left><font face=Arial size=2>F5 is one. Build/Rebuild/Solution/Project are all essentially doing the same thing: telling MSBuild on each of a set of projects to either build or rebuild.</font></p> <p align=left> </p> <p align=left>If you're seeing a build happen when it shouldn't using build solution, increase verbosity to see why -- I posted how higher up the thread</p> <p align=left> </p> <p align=left>Dan</p>Thu, 29 Nov 2007 04:46:36 Z2007-11-29T04:46:36Z