question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DotNetCoreCLI - 'pack' does not allow arguments to be passed

See original GitHub issue

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Feature

Enter Task Name: DotNetCoreCLI - pack command should allow arguments to passed like the other commands do.

Environment

Azure Pipelines - Hosted Agent - windows-latest

Issue Description

Currently there is no way to addition arguments to the pack command e.g --no-build --no-restore This is further limiting as one cannot pass MSBuild properties e.g /p:Property

Attempting the following:

- task: DotNetCoreCLI@2
      inputs:
        command: 'pack'
        packagesToPack: 'src/My.Sample.Api/*.csproj'
        packDirectory: '$(Build.ArtifactStagingDirectory)/application'
        versioningScheme: 'off'
        arguments: '/p:NuspecFile=My.Sample.Api.nuspec /p:IsPackable=true --no-build --no-restore'

Does not yield the expected results. The following command is run:

"C:\Program Files\dotnet\dotnet.exe" pack d:\a\1\s\src\My.Sample.Api\My.Sample.Api.csproj --output d:\a\1\a\application /p:Configuration=Release --verbosity Detailed

The arguments are ignored. This is inconsistent with the other commands in the DotNetCoreCLI task like build/restore/etc as mentioned in #9789

The expected result would be

"C:\Program Files\dotnet\dotnet.exe" pack d:\a\1\s\src\My.Sample.Api\My.Sample.Api.csproj --output d:\a\1\a\application /p:Configuration=Release /p:NuspecFile=My.Sample.Api.nuspec /p:IsPackable=true --no-build --no-restore --verbosity Detailed

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:22
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
leomotycommented, Sep 16, 2020

This is definitely annoying for us also, would like to keep using the glob pattern support for finding the projects, but going custom means there is no advantage whatsoever in using the Task anymore.

1reaction
scp-mbcommented, Jun 9, 2020

Thanks for the example @musmuris. Tweaked it to our requirements and that does work fine, which is as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DotNetCoreCLI does not accept arguments property on pack ...
Hello,. The argument input only currently accepts arguments for build, publish, run, test, custom. Since you would like to add arguments for pack...
Read more >
Azure pipeline using DotNetCoreCLI pack command on .NET ...
DotNetCoreCLI @2 Pack command does not support arguments argument. Arguments to the selected command. For example, build configuration, ...
Read more >
DotNetCoreCLI@2 - .NET Core v2 task - Microsoft Learn
Use when command = pack. Package Folder. Default: $(Build.ArtifactStagingDirectory). #nobuild: false # boolean. Optional. Use when command = ...
Read more >
Combining multiple code coverage results in Azure DevOps
Doing this will allow your pipeline to run code coverage across your ... out in this configuration is the arguments that are passed...
Read more >
Using multi-stage YAML pipeline to create and publish NuGet ...
My preferred way of working with NuGet packages is to first create a ... This way a separate build & release pipeline is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found