But when we switch to /p:config=debug the build fails with the known errors about missing *.res files. We looked up in the delphi lib/win32/ directory and realized that there are *.res files in the release folder but not in the debug folder. We now further modified the msbuild command to this:
##[warning]Project1.dproj(639,5): Warning MSB4011: "C:\delphi\19.0\Bin\CodeGear.Delphi.Targets" cannot be imported again. It was already imported at "C:\Build\vsts-agent-win-x64-2.160.1\_work\1\s\Projects\Project1.dproj (511,5)". This is most likely a build authoring error. This subsequent import will be ignored.