continuous-integrationazure-devopsconfiguration-filesweb-config-transformvisual-studio-2017-build-tools

Get all config files (which created using Transformation under web.config) into VSTS CI Build Artifacts


I have a web project which has one web.config and other three web configs. web.Debug.config, web.Staging.Config and web.Release.config. I want these three config files into my VSTS CI Build Artifacts. My configs location structure in solution explorer within visual studio as below.

Web.config
|__Web.Debug.config
|__Web.Staging.config
|__Web.Release.config.

For complete my purpose I set the Build Action and Copy to Output Folder properties for these files using Visual Studio. So i tried following combinations but my VSTS CI Build Artifact is not showing these configs.

Build Action = Content
Copy to Output Folder = Copy If Newer

Above combination didn't work. Than i tried following.

Build Action = Content
Copy to Output Folder = Copy Always

But this combination also failed. Can you please let me know the right combination which keep my these three configs in VSTS CI Build artifacts.


Solution

  • Get all config files (which created using Transformation under web.config) into VSTS CI Build Artifacts

    First, make sure those changes about Build Action and Copy to Output Folder properties are committed and synced to your Repos, use the Copy Files task to copy those files from build directory to Artifacts.

    I have created a sample to do this, you can check the build definition for Copy Files task and Publish Artifact task:

    enter image description here

    Only copy the \bin folder.

    enter image description here

    The Build Artifacts result:

    enter image description here

    If above not help you, please share more detailed info about your build definition.

    Hope this helps.