简体   繁体   中英

Azure Devops No such file or directory

I am trying to reference a test dll for signatures in azure devops however I am getting a no such file or directory error. I believe I am referencing it correctly as I can read the dockerfile just fine.

Error: "/home/vsts/work/1/s/Myfolder/TestAssembly.dll": No such file or directory

Yaml

variables: 
    dockerfilePath: '$(Build.SourcesDirectory)/Myfolder/Dockerfile-SignedAssembly'
    testAssemblyPath: '$(Build.SourcesDirectory)/Myfolder/TestAssembly.dll'

- task: CmdLine@2
  displayName: CodeSign
  inputs:
    script: |
      '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool" sign /tr http://timestamp.digicert.com 
          /fd sha256 /td sha256 /sm /sha1 "$(Cert.secureFilePath)" 
          /d "My Project description"
            $(testAssemblyPath)'

From your pipeline definition, if you don't have any other steps, then the structure of your repo must be like this:

在此处输入图像描述

And as Shayki said, you can use dir to list files:

pool:
  vmImage: ubuntu-latest

steps:

- script: |
    cd Myfolder
    dir
  displayName: 'Run a multi-line script'

If your command can't find the file, then the issue is expected.

If you build the projects in the pipeline, the path should be like this(For example, if you are based on.NetCore 3.1):

testprojectname\bin\Debug\.netcoreapp,version=v3.1\testprojectname.dll

For what is the specific path, you can refer to the situation on local.

Let me know if you have more concerns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM