title: How do I control where the output of a ClickOnce application is built (using Microsoft.Build.BuildEngine) to?
body: <p>I have a ClickOnce WPF application that I am using Microsoft.Build.BuildEngine to build.  Everything appears to be working correctly, but when doing a targeted build to publish the application it is putting the published output to .\bin\Release\app.publish</p>
  
  <p>This is despite setting the properties "PublishURL", "OutDir", "WebProjectOutputDir" - is there another property that I can set to accomplish this?</p>
  
  <p>Is there a way to control where the app.publish directory is created?</p>
  
  <pre><code>projectToBuild.SetProperty("OutDir", workingDirectory);
  projectToBuild.SetProperty("WebProjectOutputDir", workingDirectory);
  projectToBuild.SetProperty("PublishURL", workingDirectory);
  projectToBuild.Build("publish");
  </code></pre>
  
  <hr>
  
  <p>It looks like it always publishes to "OutputPath"\app.publish I've tried the following:</p>
  
  <pre><code>var myOutputPath1 = projectToBuild.GetEvaluatedProperty("OutputPath");
  projectToBuild.SetProperty("OutputPath", workingDirectory);
  var myOutputPath2 = projectToBuild.GetEvaluatedProperty("OutputPath");
  </code></pre>
  
  <p>Unfortunately myOutputPath1 and myOutputPath2 are the same, it appears the "OutputPath" is not being updated.</p>