<p>I have a solution with several projects, where the startup project has a post-build event that does all the copying of "plugin" projects and other organizing tasks. After upgrading the solution from VS 2005 to VS 2008, it appears as though the post-build event only fires if I modify the startup project, which means my updated plugins don't get plugged in to the current debugging session. This makes sense, but it seems like a change in behavior. Is anyone else noticing a change in behavior with regard to which projects get built?</p>

<p>Does anyone know of a workaround that I can use to force the startup project to rebuild whenever I hit F5? Perhaps I configured VS 2005 to work this way so long ago that I've forgotten all about it ...</p>

[{'answer_id': 15699, 'author': 'lomaxx', 'author_id': 493, 'author_profile': 'https://Stackoverflow.com/users/493', 'pm_score': 2, 'selected': False, 'text': "<p>I don't know if this is the right way to do it but you could add a prebuild event to your startup projcet (if it's static) to clean the project which will force a rebuild.</p>\n\n<p>something like:</p>\n\n<pre><code>devenv project.csproj /clean\n</code></pre>\n"}, {'answer_id': 15724, 'author': 'OJ.', 'author_id': 611, 'author_profile': 'https://Stackoverflow.com/users/611', 'pm_score': 3, 'selected': True, 'text': '<p>Why not just add a dependency to the "startup" project for each of the plugins? This will force the project to be rebuilt if any of the others change, and you won\'t have to mess with any other pre/post-build events.</p>\n'}, {'answer_id': 15789, 'author': 'xanadont', 'author_id': 1886, 'author_profile': 'https://Stackoverflow.com/users/1886', 'pm_score': 3, 'selected': False, 'text': '<p>I think you need to reorganize the responsibilities.  Each component should be responsible for itself and therefore copy its generated goodness where it needs to go.  That way it doesn\'t matter if/who/what/when/where got built.  Whatever is updated will put itself into the proper place.</p>\n\n<hr>\n\n<p>IMO the other suggestions are no-nos since they\'ll circumvent the compiler\'s smarts to know when a rebuild is necessary for the main project.  And hence killing any compile time-savings.  If your "plugin" projects are assemblies (and not just project-references from the main project), then you do not need to rebuild the main project each time a plugin is rebuilt.  The new assembly will get selected into the process / debugger w/o the main project needing a rebuild.</p>\n'}, {'answer_id': 16045, 'author': 'John Richardson', 'author_id': 887, 'author_profile': 'https://Stackoverflow.com/users/887', 'pm_score': 2, 'selected': False, 'text': "<p>This is a pain. What we really need is for Microsoft to allow us to hook into a Post-Solution Build event. You can do this via macros but that's too complicated.</p>\n\n<p>I'm assuming this is a C++ project because I don't have this problem with C#.</p>\n\n<p>This is my solution, it's not elegant but it works:</p>\n\n<ul>\n<li>Create a new project whose only purpose is to run the post-build script. Mark it as dependent on every other project in the solution.</li>\n<li>Add a dummy file to that project called dummy.h or whatever.</li>\n<li>Right click on dummy.h in Solution Explorer and select Properties.</li>\n<li>Select 'Custom Build Step'.</li>\n<li>For the command line type 'echo' and for Outputs just type 'dummy' or something else that will never exist.</li>\n</ul>\n\n<p>This project, and therefore the post-build script, will now be run on every build.</p>\n\n<p>John.</p>\n"}, {'answer_id': 16098, 'author': 'John Richardson', 'author_id': 887, 'author_profile': 'https://Stackoverflow.com/users/887', 'pm_score': 1, 'selected': False, 'text': '<p>flipdoubt: they are projects created originally in 2008. My suggestion if it\'s not working C# is to look in the Build Events tab and check the setting of the "Run the post-build event:" drop down. If it is set to \'When the build updates the project output\' this might be your problem, try setting to \'On successful build\'.</p>\n\n<p>John.</p>\n'}, {'answer_id': 619744, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>I'm having the same issue here and it is VERY annoying.  John Richardson is right in that there should be a Post-Solution Build event (and a Pre-Solution Build event) that applies whenever ANY project in the solution is being built.</p>\n\n<p>I don't think there is any good workaround to get this outcome in the current VS 2008 IDE.</p>\n"}, {'answer_id': 3814728, 'author': 'Cristian Diaconescu', 'author_id': 11545, 'author_profile': 'https://Stackoverflow.com/users/11545', 'pm_score': 0, 'selected': False, 'text': '<p>Starting from @lomaxx suggestion, I got a very similar setup working by adding the following line at the <em>end</em> of the <em>post-build</em> event of the startup project:</p>\n\n<pre><code>"$(DevEnvDir)devenv.exe" "$(ProjectPath)" /clean\n</code></pre>\n\n<p>Note that this makes the startup project build the <em>next</em> time you need to debug, so you should make sure the project gets built at least once.</p>\n\n<p>PS. I initially tried the pre-build as suggested, but that didn\'t work (and I think it makes sense - if VS thinks a project doesn\'t need building, it won\'t execute any events for that project).</p>\n'}]
['https://Stackoverflow.com/questions/15678', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/470/']