简体   繁体   中英

Azure Devops Pipelines dotnet publish task ignores projects setting

I have a repo with a couple of do.net projects, two of them web projects, and I need to specify which to publish.

My yaml file is:

trigger:
- master

pool:
  vmImage: ubuntu-latest

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    projects: '**/Squil.Web.csproj'
    arguments: '-o $(Build.ArtifactStagingDirectory)'

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

Something similar worked as long as I had only one web project, but after factoring out most Blazor related stuff into another project Squil.Razor , it no longer does: The publish task always picks that one, which is a Razor Class Library.

I also tried to use 'Squil.Web' as the projects parameter, but no matter what I put there, it gets ignored.

I've been pulling my hair out over this for hours now. I found a related question from which I got the syntax '**/Squil.Web.csproj' , but that didn't work for me either.

I know I can use the do.net command line instead, but I'd rather use the task.

This is .NET 6.

What else to try?

I found what's wrong.

Unless publishWebProjects: false is explicitly specified projects is ignored.

Not the best defaults in my book.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM