Skip to content

[BUG]: DotNetCoreCLI@2 publish removes the produced ZIP file and leaves the ZIP source files in place #20974

Open
@kosa-gyula-77

Description

@kosa-gyula-77

New issue checklist

Task name

DotNetCoreCLI

Task version

2.247.3

Issue Description

DotNetCoreCLI@2 zipAfterPublish set to true confuses things: it removes the produced ZIP file and leaves the ZIP source files in place.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
    Microsoft Hosted
    VMSS Pool
    Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows-latest

Relevant log output

C:\Program Files\dotnet\dotnet.exe" publish D:\a\1\s\app\Service.csproj --configuration Release --no-restore --no-build --output D:\a\1\a\app_service
...
##[debug]Zip Source: D:\a\1\a\app_service
##[debug]Zip arguments: Source: D:\a\1\a\app_service , target: D:\a\1\a\app_service.zip
##[debug]Successfully created archive D:\a\1\a\app_service.zip
##[debug]rm -rf D:\a\1\a\app_service
##[debug]removing directory D:\a\1\a\app_service

Subsequent task:
ls D:\a\1\a
========================== Starting Command Output ===========================
app_service

Full task logs with system.debug enabled

No response

Repro steps

- task: DotNetCoreCLI@2
  displayName: Publish (dotnet)
  inputs:
    command: 'publish'
    modifyOutputPath: false
    zipAfterPublish: true
    publishWebProjects: false
    arguments: '--configuration Release --no-restore --no-build --output $(Build.ArtifactStagingDirectory)/app_service'
    projects: ...

Activity

added
Area: ABTTAkvelon Build Tasks Team area of work
and removed on Apr 8, 2025
raujaiswal

raujaiswal commented on Apr 16, 2025

@raujaiswal
Contributor

Hey @kosa-gyula-77 ,
The debug statement can indeed be slightly misleading. Initially, the ZIP file is produced with the path D:\a\1\a\app_service.zip. After the app_service directory and its published output files are deleted, the app_service directory is recreated, and the path of the ZIP file changes to $(Build.ArtifactStagingDirectory)/app_service/app_service.zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @kosa-gyula-77@v-schhabra@raujaiswal

    Issue actions

      [BUG]: DotNetCoreCLI@2 publish removes the produced ZIP file and leaves the ZIP source files in place · Issue #20974 · microsoft/azure-pipelines-tasks