Especially when using Delphi 2007 on Windows x64 system (8.x, 7, Vista, 2012 Server, 2008 Server, …), the Delphi specific .Targets files used by msbuild are simply installed to the wrong location.
A better warning for this is in my BeSharp.net repository: Run-Dependend-rsvars-From-Path.bat thanks to David Millington who wrote this:
If you copy
- Borland.Common.Targets
- Borland.Cpp.Targets
- Borland.Delphi.Targets
- Borland.Group.Targets
from
- %windir%\Microsoft.NET\Framework\v2.0.50727
to
- %windir%\Microsoft.NET\Framework64\v2.0.50727
then building via the command line works.
The rsvars.bat file is correct.
Note that my batch file checks for all target file sets:
Delphi 2007:
set requiredTargets=Borland.Common.Targets Borland.Cpp.Targets Borland.Delphi.Targets Borland.Group.Targets
Delphi 2009 and up:
set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Deployment.Targets CodeGear.Group.Targets CodeGear.Idl.Targets CodeGear.Profiles.Targets if %bdsVersion%==8 set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Group.Targets CodeGear.Idl.Targets if %bdsVersion%==13 set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Deployment.Targets CodeGear.Group.Targets CodeGear.Profiles.Targets
–jeroen
via [WayBack] QualityCentral: Project compiles fine under IDE, but not using MSBuild.