MSBuild warnings (MSB4011 and others) when building Delphi 10 project group

In Azure DevOps I have created a yaml build script that uses the MSBuild@1 task to build a Delphi 10.2 Project Group file.

For every project in the group, i get the following MSBuild warning:

##[warning]C:\delphi\19.0\bin\CodeGear.Common.Targets(0,0): Warning : Expected configuration file missing - C:\WINDOWS\ServiceProfiles\NetworkService\AppData\Roaming\Embarcadero\BDS\19.0\EnvOptions.proj

For the first project in the group I also get this warning:

##[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.

I have no idea to fix these warnings, they are coming from the target files that are provided by Delphi.


The first occurs, probably because Delphi was installed in different user from where the agent was setup. Make sure Delphi and agents are on the same account.

The second one, occurs, because in the *.dproj file, you have duplicate lines, referring to "\CodeGear.Delphi.Targets". Make a search and you will find them. Just keep one of them.

I just had the same problems, and solved them, as described.