[英]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.我有一个包含几个 do.net 项目的回购协议,其中两个是 web 项目,我需要指定要发布的项目。
My yaml file is:我的 yaml 文件是:
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.只要我只有一个 web 项目,类似的东西就可以工作,但是在将大部分 Blazor 相关内容分解到另一个项目Squil.Razor
,它不再这样做:发布任务总是选择那个 Razor Class 库。
I also tried to use 'Squil.Web'
as the projects
parameter, but no matter what I put there, it gets ignored.我还尝试使用'Squil.Web'
作为projects
参数,但无论我放在那里什么,它都会被忽略。
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.我发现了一个相关问题,从中我得到了语法'**/Squil.Web.csproj'
,但这对我也不起作用。
I know I can use the do.net command line instead, but I'd rather use the task.我知道我可以改用 do.net 命令行,但我宁愿使用任务。
This is .NET 6.这是 .NET 6。
What else to try?还有什么可以尝试的?
I found what's wrong.我发现出了什么问题。
Unless publishWebProjects: false
is explicitly specified projects
is ignored.除非publishWebProjects: false
被明确指定的projects
被忽略。
Not the best defaults in my book.不是我书中最好的默认值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.