Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do my projects build when there are no changes?

I've got many C# (Visual Studio 2008) projects and a few of them are updating the assembly even when there have been no changes (even when I choose Build and not Rebuild). Most of my projects don't do this, its just the odd few.

I have yet to find any difference between the projects and wondered if anyone had any ideas what could be influencing it. To be clear, I've not made any code changes before building but the assembly is still being recreated when I run the Build command within Visual Studio.

I'm sorry I can't provide any further details but please let me know if there is anything else that I can check that may shed some light.

Can anyone help? I've been tearing my hair out for a while on this.

Thanks, Alan

like image 495
Alan Spark Avatar asked Nov 28 '10 20:11

Alan Spark


Video Answer


1 Answers

Actually Hans' now-deleted answer pointed me to the right direction. Cranking up MSBuild's verbosity to diagnostic told me that VS considered a project always out of date because one file had "Copy to output directory" set to "Copy always". And the other projects followed from that because they depended on that project an noticed that the newly-built DLL was newer than one of their own output files.

Changing "Copy to output directory" to "Copy if newer" resolved that.

like image 182
Joey Avatar answered Sep 18 '22 01:09

Joey