Closed trojanfoe closed 3 years ago
When rebuilding, I see this in the build output:
Using "Delete" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1> Task "Delete"
1> Deleting file "C:\Users\Andy\Documents\Source\ProjectName\x64\Debug\pugixml_d.dll".
1> Done executing task "Delete".
I am wondering if this is because vcpkg/msbuild doesn't realise there is a dependency on pugixml because it's the only header file that isn't installed into it's own sub-directory; instead it's installed into the top-level vcpkg\installed\x64-windows\include
directory?
Added a vcpkg manifest file to my project and set "use manifest" to "yes" in the VS project in order to explicitly state my dependencies:
{
"name": "projectname",
"version-string": "0.0.1",
"dependencies": [ "directxtk", "pugixml", "effolkronium-random", "utfcpp", "yaml-cpp" ]
}
Didn't make a difference, so it's not a dependency issue.
Thanks for reporting this issue to us! In order to investigate this issue, could you please provide us with your ProjectName.vcxproj file? Through this file, we may find out why the delelate task is triggered.
Hi there, I have tried to checkout the previous commit showing the error but I have been unable to get it working. I therefore created a test project to try and reproduce the issue but of course this works perfectly and the dll is being copied into $(TargetDir)
as expected.
Sorry to waste your time on this :|
@Cheney-W I have managed to reproduce the issue. MyProject.vcxproj.txt
After initial build I see the following references to pugixml
in the output window:
Task "Message"
1> C:\Users\...\x64\Debug\pugixml_d.dll
1> Done executing task "Message".
...
Did not copy from file "C:\Users\...\x64\Debug\pugixml_d.dll" to file "C:\Users\...\x64\Debug\pugixml_d.dll" because the "SkipUnchangedFiles" parameter was set to "true" in the project and the files' sizes and timestamps match.
and running the .exe
from File Explorer works fine.
Then hit F5
and I see:
Task "Delete"
1> Deleting file "C:\Users\...\x64\Debug\pugixml_d.dll".
1> Done executing task "Delete".
and an error dialog.
@trojanfoe Thanks for your reply! I have some questions need confirm with you:
@Cheney-W
I can't repro this issue, could you attach full log from build output?
We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.
This one is very hard to reproduce. I occasionally have something very similar using VS2019. A very new C++ console project started, building OK, using vcpkg manifest mode, all working awesome, auto-copies all required DLLs from vcpkg, then setting up precompiled headers and I started to have the problem where DLLs were not copied. They are always removed by doing a build, and if I'm running by Ctrl+F5 to run without debug then it starts up very fast when using PCH. Perhaps there's a race condition and the fast build/run wins the race, but loses execution due to the need for DLLs?
I also have this issue for some reason, I'm running on my own vcpkg fork with a port updated if that matters. I fixed it by cd to vcpkg directory and re-run these commands:
bootstrap-vcpkg.bat
vcpkg integrate install
Describe the bug The dependent library (pugixml in this case) is successfully linked and the dll copied into $(TargetDir) (I see it in File Explorer), however when I run the .exe the .dll file gets removed. After this happens the dll will never be copied into $(TargetDir) again during subsequent builds.
Environment
To Reproduce Steps to reproduce the behavior:
Expected behavior The dll remains in the $(TargetDir).
Failure logs Error dialog produced: The code execution cannot proceed because pugixml_d.dll was not found. Reinstalling... blah blah.
Additional context