I discovered this issue when I added an Access DB file to my project and set it to Copy if newer:
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?
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With