Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Copy if newer replaces not only when a file in the output dir is older?

I discovered this issue when I added an Access DB file to my project and set it to Copy if newer: enter image description here

I thought it would be copied to the output directory only if a file in the output directory is older than the file in the project directory.

In fact it is copied even if the file in the output directory is newer: for example when I edited and saved it by my program.

Also I tested it in another project using another kind of file (.txt).

MSDN says

Select Copy if newer if the file is to be copied only when it is newer than an existing file of the same name in the output directory.

Is it a bug or am I doing something wrong?

like image 705
Alex P. Avatar asked Feb 18 '23 11:02

Alex P.


1 Answers

As it turned out you were rebuilding your project. Rebuild is essentially just a clean followed by a build. This means your file got deleted, and as part of the regular build it got copied over (since there is no newer version).

like image 191
JustAnotherUserYouMayKnow Avatar answered Apr 26 '23 23:04

JustAnotherUserYouMayKnow