I am trying to set up a Build on an on premise Team Foundation Server 2015 using web.config transformations. The transformations work fine based on the build configuration I select. I have 3 build configurations: Debug, Release, and one that I created, called "Staging". I am trying to make it so I can re-use the same Build for different environments by setting the $(BuildConfiguration) variable at queue time. In my TFS build's "Visual Studio Build" step, when I set the $(BuildConfiguration) to "debug" the build is output to the agent folder like this: $(Build.SourcesDirectory)\projectFolder\obj\Debug\Package\PackageTmp. If I set it to "release", then it goes to $(Build.SourcesDirectory)\projectFolder\obj\Release\Package\PackageTmp. In both cases the Web.config file is transformed correctly.
However, if I set the build configuration to "Staging", the files are still placed in the "debug" folder $(Build.SourcesDirectory)\projectFolder\obj\Debug\Package\PackageTmp instead of a "Staging" folder. (Transformations also work fine in this case, and use the staging values)
This creates a problem in my "Copy Files" step. I have the "Source Folder" value in that step to $(Build.SourcesDirectory)\projectFolder\obj\ $(BuildConfiguration) \Package\PackageTmp, but when using "Staging", it cannot find the source folder because TFS is placing the build files in the "Debug" folder.
Is there a way to force TFS to place the built items (my web app files, basically) in a folder matching the build configuration parameter, in this case, "Staging"?