I have built a simple pipeline to build my solution triggered by commits to the master branch using the Azure DevOps Pipelines. I have a problem with the post build copy commands failing and returning errors
my post build copy command:
copy /Y "$(TargetDir)$(TargetFileName)" "$(MY_PATH)$(TargetFileName)"
I get the following errors:
PostBuildEvent:
copy /Y "D:\a\1\s\{some_path\file.dll}" "D:\a\1\s\BuildBin\{file.dll}"
The system cannot find the path specified.
0 file(s) copied.
the MY_PATH
environmental variable is defined in the pipeline variables and using a "CmdLine" echo %MY_PATH%
in the .yaml it echos the proper path in the console:
Starting: CmdLine
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.177.3
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
echo %MY_PATH%
========================== Starting Command Output ===========================
"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\1db7603c-e3c0-4e32-924f-c5b1fc2cf96e.cmd""
D:\a\1\s\BuildBin\
Finishing: CmdLine
I have defined the MY_PATH
to be D:\a\1\s\BuildBin\
as I witnessed that this is the solution folder,
the paths in the error are correct.
Also I have tried running a script to create the BuildBin folder as I thought the folder does not exists but its not the reason as I run the following in the .yaml:
steps:
- script: echo mkdir D:\a\1\s\BuildBin
I cant find any info on the topic any where, just this StackOverflow question and it was not helpful.
I'm running the job in Windows Windows Server 2019 environment. Needless to say the solution builds on my pc with no problems, it also builds fine in the pipeline, its just the copy that fails.