I am trying to cerate Azure DevOps Build pipeline for WinForms desktop app and the problem is I can't publish the app and also can't cerate the build artifact.
I have created one WinForms desktop application and trying to create continuous integration (CI) pipeline in Azure DevOps.
I have selected the .NET Desktop template to configure the continuous integration (CI) pipeline. It is restoring NuGet and build solution successfully.
Now I want to publish the WinForms .NET Desktop application and generate the build artifact. I have tried it with the following task (as mention in https://developercommunity.visualstudio.com/content/problem/337714/can-build-code-but-release-pipeline-says-no-artifa.html)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
Following is my complete yml code:
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)\DesktopApp\bin\'
Contents: '**'
TargetFolder: '$(System.ArtifactsDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
It cannot generate artifact which I can download or use to release pipeline.
Needs help I cannot find how to publish the WinForms .NET Desktop application and generate the build artifact.
The main goal is to save publish app with setup and release folder of the desktop application at any location on my machine.
Can anyone help me out please?