title: What TFS 2017 build task applies web.config transforms during TFS builds?
body: <p>Some original info was changed to make the post more focused on the real issue after it was found.</p>
  
  <p>These are some of the details of the current environment. I listed these only because questions were raised in other posts to determine what was and was not working in the current environment:</p>
  
  <pre><code>Upon check-in TFS 2017 successfully builds a web project on the build agent.
  A VS 2017 publish profile can manually transform the project properly
  The build machine artifact location includes both the transform and profile files
  </code></pre>
  
  <p>The artifact location is shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/HSFDr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HSFDr.png" alt="enter image description here"></a></p>
  
  <p>I have researched this in depth on Microsoft's VS site, SO and other forums, but there are so many different answers, many of them for older versions, I have been unable to piece this together.  As a result I have several sub-questions.</p>
  
  <p>1) <strong>Can transforms be engaged in both Builds and Releases?</strong>. I read that transforms are applied during the publish process, not the build process, and that made me wonder if it is even possible to do this during a Build. But then when I was exploring releases, I saw all the same tasks usable in a Build, which suggests I can publish with a transform in either Build or Release.  Is that correct?</p>
  
  <p>2) <strong>Does TFS 2017 require a lot of special handling to engage a transform file?</strong>  Some of the posts instructed the editing of the .proj file. I wanted to get a confirmation before doing that kind of detailed manipulation, especially given the improvements in TFS 2017.</p>
  
  <p>The following information is the state of the current build definition named "confPanner-CI".  The shaded PS script was successfully used to upload to the hosting location to test the whole process, but that is not adequate for the task at hand which requires transforms to be applied:</p>
  
  <p><a href="https://i.stack.imgur.com/deG8A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/deG8A.png" alt="enter image description here"></a></p>
  
  <p>The full MSBuild Arguments which also created a temp location for the powershell script are:</p>
  
  <pre><code>/p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=c:\ConfPlnrWeb
  </code></pre>
  
  <p>If I were to add a task for publishing I saw the Publish Build Artifacts task:</p>
  
  <p><a href="https://i.stack.imgur.com/216w0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/216w0.png" alt="enter image description here"></a></p>
  
  <p>But none of the settings as shown below seem to relate to transforms:</p>
  
  <p><a href="https://i.stack.imgur.com/gUonL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gUonL.png" alt="enter image description here"></a></p>
  
  <p>The bottom line question is: <strong>How do I configure the build so the web project upload has the proper web transform applied?</strong></p>
  
  <p><strong>Update:</strong>  The following added after the answer below led to at least one place where VS transforms can be applied during a build, and presumably also a release.</p>
  
  <p>Inside the MSBuild Build solution task set the Configuration as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/1T6VK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1T6VK.png" alt="enter image description here"></a></p>