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.
Make sure you have the Regenerate Resource option checked (on the delphi actions Project property page). If that is checked, the next thing to do is have a look in the project folder, there should be a projectname.rc file there that FinalBuilder generates. Open it in notepad and check that the version info is correct. If so then that would suggest that the compiler is not linking the generated .res file. You should have a $R *.res line in your projectname.dpr file somewhere.
HTH