.NET Framework 是否有发布任务? (不是 .NET 核心)

Is there a publish task for .NET Framework? (NOT .NET Core)

根据 MSDocs here,有一个发布带参数的 .NET Core 的任务。

dotnet publish --output $(Build.ArtifactStagingDirectory)

但我有一个 .NET Framework 应用程序,而不是 .NET Core,这意味着我使用 MSBuild 任务而不是 dotnetcore 任务来构建 .NET。所以我查看了 .NET Framework page,实际上没有关于发布 .NET Framework 应用程序的信息...

这是否意味着相同的 dotnetcore 任务 apply/can 将用于 .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'

以下构建适用于 ubuntu 构建代理:

yaml 定义:

steps:

- task: NuGetToolInstaller@1    
  displayName: 'Use NuGet '    

- task: NuGetCommand@2    
  displayName: 'NuGet restore'    
  inputs:    
    restoreSolution: '<my_path>.sln'    

- task: MSBuild@1    
  displayName: 'Build solution <my_path>.sln'    
  inputs:    
    solution: '<my_path>.sln'    
    platform: '$(BuildPlatform)'    
    configuration: '$(BuildConfiguration)'    

- task: CopyFiles@2    
  displayName: 'Copy Files to: $(build.artifactstagingdirectory)'    
  inputs:    
    SourceFolder: '$(system.defaultworkingdirectory)'    
    Contents: '**/bin/**'    
    TargetFolder: '$(build.artifactstagingdirectory)'    
  condition: succeededOrFailed()
       
- task: PublishBuildArtifacts@1    
  displayName: 'Publish Artifact: drop'    
  inputs:    
    PathtoPublish: '$(build.artifactstagingdirectory)'    
  condition: succeededOrFailed()