0

I would like to add a custom build step to copy the executable from where it was built (in current active configuration, in current workspace, by currently logged in user) into a shared location. Are there any predefined environment variables in VS (?) that would contain that information? Or C# API to Visual Studio that would provide the same?

This might help: https://msdn.microsoft.com/en-us/library/42x5kfw4.aspx

These did not help: Visual Studio 2015 Extension - How to get workspace of current Solution

How to get the TFS workspace directory

Community
  • 1
  • 1
  • Which build are you using? New Vnext or old xaml build? And are you meaning the workspace created by tfs on the build agent? And where is your shared location? In the same machine ? or Other's Windows machine? – PatrickLu-MSFT Sep 23 '16 at 08:39

1 Answers1

0

VNext build

Seems you want to copy files from working folder on the agent computer.(The local path on the agent where your source code files are downloaded. For example: c:\agent\_work\1\s)

You can try to use Windows Machine File Copy task.

Source: You can use pre-defined system variables such as $(Build.Repository.LocalPath) (the working folder on the agent computer), which makes it easy to specify the location of the build artifacts on the computer that hosts the automation agent.

Destination Folder: The folder on the Windows machine(s) to which the files will be copied. Example: C:\FabrikamFibre\Web

If your shared loaction is on the same machine. You can also try to use Copy Files.

XAML build

In XAML build, you can check in your script, and specify a post-build script path in your XAML build definition. This script gathers some of the typical binary types from the typical locations and copies them to the folder from which TFBuild copies and drops to your staging location. Check more information about Run a script in your XAML build process at website: https://msdn.microsoft.com/library/dn376353%28v=vs.120%29.aspx

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62