根据此处的 MSDocs ,有一项任务是发布带有参数的 .NET Core。
dotnet publish --output $(Build.ArtifactStagingDirectory)
但是我有一个 .NET Framework 应用程序,而不是 .NET Core,这意味着我使用 MSBuild 任务而不是 dotnetcore 任务来构建 .NET。所以我查看了.NET Framework 页面,实际上没有关于发布 .NET Framework 应用程序的信息...
这是否意味着相同的 dotnetcore 任务适用/可用于 .NET Framework 应用程序?
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
# this code takes all the files in $(Build.ArtifactStagingDirectory) and uploads them as an artifact of your build.
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'myWebsiteName'