简体   繁体   中英

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: 在此处输入图片说明

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM