MSBuild, Delphi and error MSB4057: The target "build" does not exist in the project


I use MSBuild to build Delphi projects and I get the above message. 

I have tested the command as it should be if I was using the command line and the project compiles correctly?

What may be wrong here?

If a previous post (here) you recommend a check on the agent machine but I am not sure I understand this part "Check that on the build agent machine under build agent windows service running user account Delphi 2010 msbuild extensions are configured and workable." How do I do this?

The documentation, also, says that "A target is an arbitrary script for your project purposes. Enter targets separated by spaces. The available targets can be viewed in the Web UI by clicking the icon next to the field and added by checking the appropriate boxes."

I can't see ant available targets in my installation. How do I define one?

Also, TC creates a file with the parameters for the MSBUILD (xxxx.tcargs). I tried to copy and paste it in another location while the build is running but it is happening so fast that I can't. How can I inspect this file to check if it passes the correct arguments?





Hello John,

Have you tried to run the same build via command line on agent machine under the same user the agent (or agent service) is running under? I think the same was asked in the linked forum thread.

Please follow the step from the section. If build succeeds from the console but still fails in TeamCity, then please attach all the information requested in the linked doc section. Thank you!


Hi Alina,

I tried to follow the instructions and I get this:

The build command line is this:

C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\BuildAgent\work\550b8d7a6b1aeb7c /msbuildPath:C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe

When I run it in the build machine with the agent disabled, the output file says that "buildfile" parameter should be defined

How do I pass this parameter?




Hello John,

What runner do you use in TeamCity? Please attach full build log.

In the command line please try to run MSBuild.exe command with parameters (not JetBrains.BuildServer.MsBuildBootstrap.exe).



When you say "what runner" what exactly do you mean?

Please find the build log here:

I tried the actual MSBuild command at first place and reported that it works correctly on the machine with the build agent.






Thank you for details. 

Please try to use a command line runner in TeamCity to launch the same command as in the console. If the command line runner works but the dedicated runner does not while the options are all the same, please create a new issue in our tracker detailing the case. Please attach all the build step settings, the build log, all agent logs covering the build, the command you used in the console to run the build and the full console output of the build.


Please sign in to leave a comment.