Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzDO DotNetCoreCLI@2 task fails during pack #7872

Closed
khamza85 opened this issue Aug 10, 2022 · 1 comment
Closed

AzDO DotNetCoreCLI@2 task fails during pack #7872

khamza85 opened this issue Aug 10, 2022 · 1 comment
Labels
needs-triage Have yet to determine what bucket this goes in.

Comments

@khamza85
Copy link

We installed MSBuild version 17.3.0+92e077650 in our build agent. Then this AzDO task started failing

steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet pack'
  inputs:
    command: pack
    packagesToPack: MySolution.sln
    buildProperties: 'PackageVersion=$(PkgVersion)'

Here is what the AzDO task generates:

D:\VSTSAgentsWork\01\_tool\dotnet\dotnet.exe pack D:\VSTSAgentsWork\01\786\s\MySolution.sln --output D:\VSTSAgentsWork\01\786\a /p:Configuration=Release;PackageVersion=3.0.145385-beta --verbosity Normal

and this is the error we get

error MSB4126: The specified solution configuration "Release;PackageVersion=3.0.145385-beta|Any CPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.

This however used to work with MSBuild version 17.2.0+41abc5629.

The only workaround is to use a custom command for DotNetCoreCLI@2 task:

- task: DotNetCoreCLI@2
  displayName: 'dotnet custom'
  inputs:
    command: custom
    projects: MySolution.sln
    custom: pack
    arguments: '-c $(BuildConfiguration) -p:PackageVersion=$(PkgVersion)-beta -v Normal -o $(Build.ArtifactStagingDirectory)'
@khamza85 khamza85 added the needs-triage Have yet to determine what bucket this goes in. label Aug 10, 2022
@baronfel
Copy link
Member

This is a bug in the SDK, not MSBuild: dotnet/sdk#27059

@baronfel baronfel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

No branches or pull requests

2 participants