Empty build artifacts in Visual Studio Team Services
H

1

6

I have a build definition in Visual Studio Team Services with the following steps:

  • PowerShell (prebuild.ps1 powershell script that sets up DNX
  • NuGet Installer
  • Visual Studio Build
  • Copy and Publish Build Artifacts

The MSBuild arguments in the Visual Studio Build step are as follows:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true 
/p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)"

And the Copy Root in Copy and Publish Build Artifacts is set to $(build.stagingDirectory) with Contents set to ***.* and Artifact name set to drop.

The build succeeds, but when I look in the Artifacts, it's just an empty drop.zip.

Looking at the logs for the Publish Artifacts step, it says

2016-04-28T07:37:41.7047278Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.98.1\tasks\CopyPublishBuildArtifacts\1.0.22\CopyPublishBuildArtifacts.ps1
2016-04-28T07:37:41.8467280Z Preparing artifact content in staging folder C:\a\1\a...
2016-04-28T07:37:41.9187272Z Total files copied: 0.
2016-04-28T07:37:42.3778918Z Max Concurrent Uploads 2, Max Creators 1
2016-04-28T07:37:42.4218914Z Found 0 files to upload.
2016-04-28T07:37:42.4268927Z Created 0 files without uploading content. Total files processed 0
2016-04-28T07:37:42.4288961Z Uploaded artifact 'C:\a\1\a\drop' to container folder 'drop' of build 38.
2016-04-28T07:37:42.6274164Z Associated artifact 31 with build 38

Why are there no files to upload? I'm looking to eventually create a web deploy package that I can then deploy as an azure web app, but getting the package in the first place doesn't appear to work.

Edit: when I run msbuild locally with the same parameters, I get an artifacts directory with bin and obj subdirectories containing a bunch of .nupkg files, some dlls and some other assorted things, not a .zip file. It seems like I'm missing something, but all the tutorials I can find tell me to use these msbuild parameters.

Hooper answered 28/4, 2016 at 7:50 Comment(0)
G
5

According to your description, you are build an Asp.Net Core project. Then the issue may caused by the arguments you use. There is no file generated in "$(build.stagingDirectory)" folder with this arguments. Try to set the arguments to

"/t:Build,FileSystemPublish
/p:PublishConfiguration=$(BuildConfiguration)
/p:PublishOutputPathNoTrailingSlash=$(Build.SourcesDirectory)\{yourProjectName}\artifacts\bin\$(BuildConfiguration)\Publish"

and then copy files from

"$(Build.SourcesDirectory)\{yourProjectName}\artifacts\bin\$(BuildConfiguration)\Publish".

Refer to this link for details: Build and Deploy your ASP.NET 5 Application

Gerontology answered 28/4, 2016 at 9:17 Comment(2)
That definitely did the trick, thanks! Is there an article on MSDN that describes the steps in more details? The one you linked to just says stuff like "add this script", but doesn't actually explain why the step is needed or what it does.Hooper
the link looks dead to me? anyone else have the this problem?Moya

© 2022 - 2024 — McMap. All rights reserved.