Azure devops Azure DevOps管道复制文件任务目标目录值

Azure devops Azure DevOps管道复制文件任务目标目录值,azure-devops,azure-pipelines,Azure Devops,Azure Pipelines,我是Azure DevOps的新手。我试了很多方法,但都没用。我正在尝试创建一个具有复制文件任务的管道。我有如下文件夹结构 Bin Common abc.dll Staging Bin Common Variable Name: BinCommonStagingFolder Variable Value: $(Build.Repository.LocalPath)\Staging\Bin\Common\ 我想将abc.dll从Bin\Common复制到Staging

我是Azure DevOps的新手。我试了很多方法,但都没用。我正在尝试创建一个具有复制文件任务的管道。我有如下文件夹结构

Bin
  Common
    abc.dll

Staging
  Bin
    Common
Variable Name: BinCommonStagingFolder
Variable Value: $(Build.Repository.LocalPath)\Staging\Bin\Common\
我想将abc.dll从Bin\Common复制到Staging\Bin\Common

在我的“复制文件”任务中,我将在下面给出

Source: Bin/Common
Contents: *.dll
Target Folder: Staging/Bin/Common

In Advanced:
Clean Target Folder: Check
Overwrite: Check
复制文件任务成功,当我转到Repo时,在Staging\Bin\Common文件夹中看不到abc.dll。在我的复制文件任务日志中,我看到

Copying D:\a\1\s\Bin\Common\abc.dll to Staging\Bin\Common\abc.dll
我想一定是这样

Copying D:\a\1\s\Bin\Common\abc.dll to D:\a\1\s\Staging\Bin\Common\abc.dll
提前谢谢

解决方案

感谢
4c74356b41
为我指明了正确的方向。我接受并标记为答案。正如建议的那样,我创建了一个变量并使用它,如下所示

Bin
  Common
    abc.dll

Staging
  Bin
    Common
Variable Name: BinCommonStagingFolder
Variable Value: $(Build.Repository.LocalPath)\Staging\Bin\Common\
我在下面的复制文件任务中使用了变量,仅复制我不需要的所有文件

Source: Bin/Common
Contents: 
abc.dll
abc.pdb
Target Folder: $(BinCommonStagingFolder)

In Advanced:
Clean Target Folder: Check
Overwrite: Check

我想您应该添加完整路径,您可以使用build varible:

Target Folder: $(Build.Repository.LocalPath)\Staging\Bin\Common\

这将引用您签出的回购的根

我想您应该添加完整路径,您可以使用build varible:

Target Folder: $(Build.Repository.LocalPath)\Staging\Bin\Common\

这将引用你签出的回购协议的根

哇,你太棒了。。这解决了我的问题。现在我看到了将D:\a\1\s\Bin\Common\abc.dll复制到D:\a\1\s\Staging\Bin\Common\abc.dll,我在我的工件中看到了abc.dll。在Azure DevOps中有一些方法。。在我的回购协议中。。在Staging\Bin\Common下,我看不到abc.dll,但我的工件有它。可能在复制到Staging\Bin\Common之后,我需要执行任何提交任务。如果您希望在repo中进行更改,那么您需要将更改提交到repo,但不确定为什么您希望在repomy场景中生成工件。。在azure构建解决方案中…以某种方式将库和pdb文件存储在某个文件夹中。。将库(DLL)和PDB复制到临时文件夹中。。然后发布具有此DLL的工件,以便我们可以将其部署到服务器。高级步骤包括:构建、移动到某个地方(或构建到这个地方)、发布工件您真了不起。。这解决了我的问题。现在我看到了将D:\a\1\s\Bin\Common\abc.dll复制到D:\a\1\s\Staging\Bin\Common\abc.dll,我在我的工件中看到了abc.dll。在Azure DevOps中有一些方法。。在我的回购协议中。。在Staging\Bin\Common下,我看不到abc.dll,但我的工件有它。可能在复制到Staging\Bin\Common之后,我需要执行任何提交任务。如果您希望在repo中进行更改,那么您需要将更改提交到repo,但不确定为什么您希望在repomy场景中生成工件。。在azure构建解决方案中…以某种方式将库和pdb文件存储在某个文件夹中。。将库(DLL)和PDB复制到临时文件夹中。。然后发布具有此DLL的工件,以便我们可以将其部署到服务器。高级步骤包括:构建、移动到某个位置(或构建到该位置)、发布工件