简体   繁体   English

Azure Devops 管道 do.net 发布任务忽略项目设置

[英]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.

相关问题 Azure DevOps Build Pipeline:“publish”命令正在执行“dotnet build”而不是“dotnet publish” - Azure DevOps Build Pipeline: 'publish' command is executing 'dotnet build' instead of 'dotnet publish' Azure DevOps YAML-dotnet核心CLI包可生成其他项目 - Azure DevOps YAML - dotnet core CLI pack builds additional projects Azure DevOps“NuGet pack”任务忽略/覆盖 package 元数据 - Azure DevOps "NuGet pack" task ignores/overwrites package metadata Azure 管道 - dotnet 发布覆盖 VSBuild.zip 然后抱怨找不到它们 - Azure pipelines - dotnet publish overwriting VSBuild .zip's then complaining it can't find them do.net 发布配置文件忽略 pubxml 文件 - dotnet publish profile ignores pubxml file 如何正确设置dotnet核心类库以在Azure DevOps中发布到NuGet feed? - How do you properly set up a dotnet core class libray to publish to NuGet feed in Azure DevOps? 发布失败:do.net 构建已退出,代码为 0(Azure Data Studio - SQL 数据库项目扩展) - Publish fails with: dotnet build exited with code 0 (Azure Data Studio - SQL Database Projects extension) 如何使用缓存任务为 Azure 管道中的所有项目缓存 nuget 包 - How to cache nuget packages for all projects in Azure Pipelines using Cache task 是在自托管 Azure DevOps 代理上安装 dotnet SDK 更好,还是在构建管道中添加 UseDotNet@2 任务? - Is it better to install dotnet SDK on self-hosted Azure DevOps agent, or add the UseDotNet@2 task in the build pipeline? Azure Devops 无法在同一 CI 任务中运行 .NET 框架和 dotnet 核心单元测试 - Azure Devops can't run .NET Framework and dotnet core unit test in the same CI task
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM