I have included some native DLLs that my project depends on into the project and set in their properties Build Action
to content
and Copy to Directory
to Copy if newer
.
I am now having the annoying behavior that the DLLs are sometimes not being copied to the output directory, when I build a project. The behavior appears to be, that when I select Build
they are not being copied, but they are being copied when I select Rebuild
. To make matters worse they are sometimes removed and I am not sure when (I believe before performing a normal Build
).
So my question is: What am I doing wrong? I have also found people using the Post-Build event to copy the DLLs, so is my way not the correct way to do it?
Edit:
I forgot to mention that I have two projects (on which the project that I am building depends) with the same Dlls included, since they both depend on EmguCV, which uses the native OpenCV Dlls, which are the ones causing the trouble.