Search code examples
continuous-integrationazure-devopsrelease-managementbuild-definitionazure-pipelines-build-task

Continuous Integration on VSTS - Build Definition: No Files - System.AggregateException


I am using Visual Studio Team Services. I created a Simple ASP.NET website and created my Build definition which contains default settings.

enter image description here

After committing changes, the build is triggered using CI. The "Build Solution" Step works fine, however no files are found in the Copy Files Step:

enter image description here

I have created the same build definition for a simple console app, and the build and release are working.

When Creating a release from this build, it fails to deploy (i guess because no files are found in (Build process)) and gives the following error:

enter image description here


Solution

  • When you build Asp.Net project with a default VSBuild definition, the folder bin\$(BuildConfiguration)\ does not exist. So "Copy Files" task cannot find any files with the default settings. A simple way to fix your issue is add /p:outdir=$(build.artifactstagingdirectory) in "MSBuild Arguments" for VSBuild task as following:

    Add custom arguments to MsBuild

    And you can also remove "Copy Files" task since "Publish Build Artifacts" task publishes the files in $(build.artifactstagingdirectory) folder by default and you have set the build output to that folder with the argument added in VSBuild task.

    Update: You can add a "Copy Files" task with the following settings to copy "roslyn" folder to "bin" folder: enter image description here