I guess I have a simple problem, but it is somehow not obvious to me:
I have VS 2022 on my build PC, and I have VS 2022 Remote Debugger on my remote target PC.
In my VS project on the build PC, in the debug properties, I configured the remote server and the remote command.
And I use a debug build.
When starting the remote process, I get several message boxes on the remote target PC about missing
- msvcp140d.dll
- ucrtbased.dll
- vcruntime140d.dll
I see the msvcp140.dll (without d) on the remote PC in C:\Program Files\Microsoft Visual Studio 17.0\Common7\IDE\Remote Debugger\x64 (next to the remote debugger exe).
I am able to debug a release build. But why do I fail with the debug build? Isn't it a usual remote debugging use case?
Obviously, and as Hans Passant correctly stated in his comment, the needed debug dlls need to be copied by hand to the target PC. I used the exe dir as destination.
See also this learn.microsoft.com article.
Alternatively consider to link against release dlls instead: see this answer.
And here are as a quick-reference the source dirs I used (although there were more instances on the debug PC, I used the files from
debug_nonredistdirs):C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.34.31931\debug_nonredist\x86\Microsoft.VC143.DebugCRT\msvcp140d.dllC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.34.31931\debug_nonredist\x86\Microsoft.VC143.DebugCRT\vcruntime140d.dllC:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.UniversalCRT.Debug\10.0.19041.0\Redist\Debug\x86\ucrtbased.dll