0
votes

We created a build pipeline yaml for our blazor webassembly project that includes a publish task. For some reason only the wwwroot folder items get generated into the drop folder, and all the other binaries that are normally located outside of the wwwroot folder are not generated for some reason.

Here is part of the yaml file that builds and publishes. Is it setup incorrectly to get all the files generated and published, or is it just that it will only give us the static files being a webassembly project?

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
    projects: '**/*.csproj'
    arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)"'
    zipAfterPublish: false

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
  condition: succeededOrFailed()

Also, since we are finding that Blazor webassembly has an issue using the Azure configuration settings for a web service, we are needing to have the publish process manipulate the web.config file so we can set the ASPNETCORE_ENVIRONMENT of the build and deploy. Everything I have found so far does not work when run in the DevOps build pipeline, as they are meant for dotnet scripts. Does anyone know how this can be done? We have tried to add site /p:EnvironmentName=Development to the --output argument of the publish task, but it says it cannot run on multiple projects, even though we set the projects argument to just the one (it is not shown above as we put it back to normal for now).

Thank you, Chris Calvert

1

1 Answers

0
votes

Did you try this?

  • task: DotNetCoreCLI@2 displayName: Publish inputs: command: publish publishWebProjects: True arguments: '--configuration $(buildConfiguration) --output "$(build.artifactstagingdirectory)" /p:EnvironmentName=Development' zipAfterPublish: True