title: Automate Delphi 2010 project build with MSBuild
body: <p>I'm looking to compile my Delphi 2010 project using MSBuild, but something isn't right, I just couldn't make MSBuild to compile my project.</p>
  
  <p>I tried this command line:</p>
  
  <blockquote>
    <p>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\MyProject\Myapp.dproj" /t:Release</p>
  </blockquote>
  
  <p>and this:</p>
  
  <blockquote>
    <p>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\MyProject\Myapp.dproj" /p:Configuration=Release /t:Release</p>
  </blockquote>
  
  <p>But MSBuild won't recognize my build configuration!</p>
  
  <p>I also changed [ <strong>rsvars.bat</strong> ] but it didn't work!</p>
  
  <pre><code>@SET BDS=C:\Program Files (x86)\Embarcadero\RAD Studio\7.0
  @SET BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\7.0
  @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
  @SET FrameworkVersion=v4.0.30319
  @SET FrameworkSDKDir=
  @SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
  @SET LANGDIR=EN
  </code></pre>
  
  <p>The MSBuild error is:</p>
  
  <pre><code>C:\MyProject\Myapp.dproj : error MSB4057: The target "Release" does
  not exist in the project.
  </code></pre>
  
  <p>Any help to get me build my app with MSBuild would be greatly appreciated.</p>
  
  <p>(Yes, I'm fully aware of tools like FinalBuilder, I just want to learn how to do this with MSBuild)</p>
  
  <p>Thanks!</p>