Illep
Illep

Reputation: 16859

How do you view the contents of the bin folder in an Azure Pipeline?

I have a solution which has multiple projects. I am using Azure Pipelines to automatically build and test the project.

However, what I noticed is that DLLs of certain sub-projects are not been copied to the bin folder. This results in warnings/errors that the said DLLs are not found.

My question is, how can I see what DLLs that are present in the bin folder? I have looked at the artifacts but, it doesn't contain the content that's suppose to be in the bin. How can I make this possible ?

trigger:
 - develop
 
 pool:
   vmImage: 'latest'
   
 variables:
   solution: '**/*.sln'
   buildConfiguration: 'Release'
 
 steps:
 
 - task: NuGetToolInstaller@1

- task: NuGetCommand@
   inputs:
     command: 'restore'
     restoreSolution: '**/*.sln'

 - task: NuGetCommand@
   inputs:
     command: 'restore'
     restoreSolution: '**/*.sln'
     feedsToUse: 'select'

  - task: VSBuild@1
   inputs:
     vsVersion: 'latest'
     msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true"'
     solution: '$(solution)'

Upvotes: 0

Views: 2547

Answers (1)

Leo Liu
Leo Liu

Reputation: 76958

How do you view the contents of the bin folder in an Azure Pipeline?'

You could add the copy task and pubulish build artifact task to publish files in the bin folder to the artifact, so that we could check it from artifact:

- task: CopyFiles@2
  displayName: 'Copy Files to bin'
  inputs:
    SourceFolder: '$(System.DefaultWorkingDirectory)'
    Contents: '**\<TheSubProjectName>\bin\**'
    TargetFolder: ' $(build.artifactstagingdirectory)\bin'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: CheckBinFolder'
  inputs:
    PathtoPublish: ' $(build.artifactstagingdirectory)\bin'
    ArtifactName: CheckBinFolder

Then we could check it from artifact:

enter image description here

Alternatively, you could add a command line task to list the files under the bin folder:

- script: |
   cd $(System.DefaultWorkingDirectory)\<SolutionName>\<SubProjectName>\bin
   
   dir /b
  displayName: 'Show the files in bin folder'

Upvotes: 3

Related Questions