Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

.NET Core Pipleines - PostBuild copy failing

BoroDrummer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2019

I have the following PostBuild configuration in my project file to copy some libraries into my output directory:

 

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy $(ProjectDir)Lib\* $(OutDir)" />
</Target> 

 

This works as expected on my dev machine, but I get the following build error in Pipelines:

 

error MSB3073: The command "copy /opt/atlassian/pipelines/agent/build/<PROJECT>/Lib/* bin/Debug/netcoreapp2.2/" exited with code 127.

 

Is there any way I can get this to work? 

1 answer

1 accepted

0 votes
Answer accepted
BoroDrummer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2019

I realized the issue was due to the fact Pipelines runs on Linux and my dev machine was windows. The "copy" command is windows specific, so to fix the issue I changed the PostBuild event to use "cp" instead:

 

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="cp $(ProjectDir)Lib\* $(ProjectDir)$(OutDir)" />
</Target>

  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events