queue:
  name: Hosted VS2017
  demands: 
  - msbuild
  - visualstudio
  - vstest

steps:
- powershell: dotnet restore
  displayName: 'Restore'

- task: VSBuild@1
  displayName: 'Build'
  inputs:
    configuration: Release

- task: VSTest@2
  displayName: 'Test'

- task: CopyFiles@2
  displayName: 'Stage image assert errors.'
  inputs:
    sourceFolder: '$(Agent.TempDirectory)'
    contents: '*.png'
    targetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
  displayName: 'Publish image assert errors.'
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'
    artifactName: 'Images'

queue:
  name: Hosted VS2017
  demands: 
  - msbuild
  - visualstudio
  - vstest

steps:
- powershell: dotnet restore
  displayName: 'Restore'

- task: VSBuild@1
  displayName: 'Build'
  inputs:
    configuration: Release

- task: VSTest@2
  displayName: 'Test'

- task: CopyFiles@2
  displayName: 'Stage image assert errors.'
  inputs:
    sourceFolder: '$(Agent.TempDirectory)'
    contents: '*.png'
    targetFolder: '$(Build.ArtifactStagingDirectory)'
  condition: failed()

- task: PublishBuildArtifacts@1
  displayName: 'Publish image assert errors.'
  inputs:
    pathtoPublish: '$(Build.ArtifactStagingDirectory)'
    artifactName: 'Images'

Copy files if test fails.
Copy files if test fails.

Tweak azure-devops.yml
