title: MSBuild Script and VS2010 publish apply Web.config Transform
body: <p>So, I have VS 2010 installed and am in the process of modifying my MSBuild script for our TeamCity build integration. Everything is working great with one exception.</p>
  
  <p>How can I tell MSBuild that I want to apply the Web.conifg transform files that I've created when I publish the build...</p>
  
  <p>I have the following which produces the compiled web site but, it outputs a Web.config, Web.Debug.config and, Web.Release.config files (All 3) to the compiled output directory. In studio when I perform a publish to file system it will do the transform and only output the Web.config with the appropriate changes...</p>
  
  <pre><code>&lt;Target Name="CompileWeb"&gt;
      &lt;MSBuild Projects="myproj.csproj" Properties="Configuration=Release;" /&gt;
  &lt;/Target&gt;
  
  &lt;Target Name="PublishWeb" DependsOnTargets="CompileWeb"&gt;
      &lt;MSBuild Projects="myproj.csproj"
      Targets="ResolveReferences;_CopyWebApplication"
      Properties="WebProjectOutputDir=$(OutputFolder)$(WebOutputFolder);
                  OutDir=$(TempOutputFolder)$(WebOutputFolder)\;Configuration=Release;" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>Any help would be great..!</p>
  
  <p><strong>I know this can be done by other means but I would like to do this using the new VS 2010 way if possible</strong></p>