2

I defined a post-build event for some of the projects in my solution, as follows:

copy /Y "$(TargetPath)" "$(build.binariesdirectory)Obfuscated"

Which results in an error:

error MSB4184: The expression """.binariesdirectory" cannot be evaluated. Method 'System.String.binariesdirectory' not found.

Azure DevOps (and TFS build systems in general) are new to me, so any help or suggestion would be appreciated.

BPDESILVA
  • 2,040
  • 5
  • 15
  • 35
Michael Daniloff
  • 695
  • 1
  • 5
  • 12
  • Those azure-devops variables are only going to be available within a pipeline. You can probably expand the macro section to see what is available for you on a post build task. – Matt Jan 04 '19 at 19:33
  • Thanks Matt, had to dig documentation and found the solution. – Michael Daniloff Jan 04 '19 at 19:37

1 Answers1

0

Turned out for the post-build events had to use a different syntax (Windows batch script )

%BUILD_BINARIESDIRECTORY%\Obfuscated

So I used

copy /Y "$(TargetPath)" %BUILD_STAGINGDIRECTORY%\Obfuscated"

and the assembly was successfully copied. Microsoft docs link on Azure pipelines

Michael Daniloff
  • 695
  • 1
  • 5
  • 12