0

I have created multiple csdef files for different environments.
I wanted to copy correct csdef file to target directory using xcopy command in prebuild event.

xcopy /Y "$(ProjectDir)ServiceDefinition.$(ConfigurationName).csdef" "$(TargetDir)ServiceDefinition.csdef"

I am getiing error xcopy exited with code 2.

S2K
  • 1,185
  • 3
  • 27
  • 55
  • Possible duplicate of [Why would a post-build step (xcopy) occassionally exit with code 2 in a TeamCity build?](http://stackoverflow.com/questions/7835304/why-would-a-post-build-step-xcopy-occassionally-exit-with-code-2-in-a-teamcity) – stijn Jan 19 '16 at 08:36

1 Answers1

0

Instead of copying environment-specific files, you could use transformations with the output going to an intermediate location. See this answer for details.

Community
  • 1
  • 1
Don Lockhart
  • 894
  • 5
  • 12