0

I would like to copy Angular UI dist folder content into published content, specifically wwwroot when using VSbuild task as shown below

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.ArtifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

My two questions are

  1. whether this task is responsible for publish that we do manually in Visual Studio, and hence can I expect wwwroot folder to be present in the corresponding target location?
  2. How do I say zip : false in the above command so that I can copy the required content and then zip later?

Thanks, AK

KeenUser
  • 5,305
  • 14
  • 41
  • 62

1 Answers1

0

whether this task is responsible for publish that we do manually in Visual Studio, and hence can I expect wwwroot folder to be present in the corresponding target location?

Yes. You can use msbuild arguments to do this:

msbuildArgs: '/p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:SkipInvalidConfigurations=true /p:DeleteExistingFiles=True /p:publishUrl="$(build.artifactStagingDirectory)"'

Use /p:WebPublishMethod=FileSystem to output the results as files, not a zip. Use /p:publishUrl={target location} to specify the output location.

How do I copy the required content and then zip later?

Add the following script to your .csproj file:

  <ItemGroup>
    <None Update="wwwroot\**" CopyToOutputDirectory="drop" />
  </ItemGroup>
Jane Ma-MSFT
  • 4,461
  • 1
  • 6
  • 12