TheProgrammer
TheProgrammer

Reputation: 1344

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)'

Upvotes: 0

Views: 6720

Answers (1)

Bowman Zhu
Bowman Zhu

Reputation: 7251

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

enter image description here

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.

Upvotes: 1

Related Questions