Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在buildyaml中进行dotnet发布_Yaml_Azure Pipelines_Asp.net Core 2.1 - Fatal编程技术网

如何在buildyaml中进行dotnet发布

如何在buildyaml中进行dotnet发布,yaml,azure-pipelines,asp.net-core-2.1,Yaml,Azure Pipelines,Asp.net Core 2.1,如果需要在.Net Core 2.1中执行测试项目,请举例说明如何在build.yaml中指定。我想不出确切的路 它在下面说,yaml的方式应该是什么 要使此任务正常工作,您必须已经使用dotnet publish--output$(build.ArtifactStagingDirectory)命令将生成的输出发布到此目录。要在发布之前将其他文件复制到此目录 例如,下面如何在build.yaml类内应用程序(API解决方案)中表示 在下面试用 - task: DotNetCoreCLI@2

如果需要在
.Net Core 2.1
中执行测试项目,请举例说明如何在build.yaml中指定。我想不出确切的路

它在下面说,yaml的方式应该是什么

要使此任务正常工作,您必须已经使用dotnet publish--output$(build.ArtifactStagingDirectory)命令将生成的输出发布到此目录。要在发布之前将其他文件复制到此目录

例如,下面如何在
build.yaml
类内应用程序(API解决方案)中表示

在下面试用

- task: DotNetCoreCLI@2
      displayName: "Prepare Publish Files"
      inputs:
        command: publish
        projects: ""
        arguments: --output $(Build.ArtifactStagingDirectory)/src/xxx.EndToEnd.Integration.Tests/xxx.EndToEnd.Integration.Tests.csproj
但请注意下面的错误,事实上我的是API解决方案,我试图发布end2end测试并在部署后运行它们

##[error]No web project was found in the repository. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory.
##[error]Project file(s) matching the specified pattern were not found.

使用下面的
YAML
code,我能够运行构建

- task: DotNetCoreCLI@2
  displayName: "dotnet e2e tests"
  inputs:
    command: publish
    publishWebProjects: false
    projects: '**/*.csproj'
    arguments: --output $(Build.ArtifactStagingDirectory)/src/xxx.EndToEnd.Integration.Tests
    zipAfterPublish: false
说明:

publishWebProjects:false
-因为这是一个API解决方案

简单的方法是在designer向导中创建任务,并在那里查看YAML文件(显示YAML文件的单独选项卡)

- task: DotNetCoreCLI@2
  displayName: "dotnet e2e tests"
  inputs:
    command: publish
    publishWebProjects: false
    projects: '**/*.csproj'
    arguments: --output $(Build.ArtifactStagingDirectory)/src/xxx.EndToEnd.Integration.Tests
    zipAfterPublish: false