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.

dotnet pack PackageVersion fails when using short form of /property (/p:PackageVersion)

See original GitHub issue

Steps to reproduce

$ dotnet pack ClassLibrary.csproj /p:PackageVersion=x.y.z

Expected behavior

Should have created a nuget package with the explicit version passed (x.y.z)

ClassLibrary.x.y.z.nupkg

Actual behavior

Microsoft ® Build Engine version 15.1.1012.6693 Copyright © Microsoft Corporation. All rights reserved. MSBUILD : error MSB1008: Only one project can be specified. Switch: p:PackageVersion=x.y.z

However if the msbuild long form of a property is used it works!!

dotnet pack ClassLibrary.csproj /property:PackageVersion=x.y.z <= works fine

Environment data

dotnet --info output: .NET Command Line Tools (1.0.3)

Product Information: Version: 1.0.3 Commit SHA-1 hash: 37224c9917

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dasMullicommented, Sep 16, 2018

@grajdeanserghei you wrote/pproperty instead of /property, I suggest using -p:PackageVersion=1.2.3

0reactions
grajdeansergheicommented, Sep 16, 2018

@dasMulli , you’re right, I uploaded wrong screenshot I wanted to upload this one image

Indeed it works with -p:PackageVersion=1.2.3 instead of /p:PackageVersion=1.2.3. It works it both git bash and cmd. Probably documentation should use -p: syntax instead.

Anyway, I’ll open a new issue.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack command - .NET CLI
The dotnet pack command creates NuGet packages for your .NET project.
Read more >
How to use the dotnet-pack --version-suffix with csproj?
According the documentation, the Version property override the version on packing, instead, use the VersionPrefix .
Read more >
Version vs VersionSuffix vs PackageVersion: What do they ...
In this post I look at the various different version numbers you can set for a .NET Core project, such as Version ,...
Read more >
Building NuGet packages with Dotnet Core | by Xavier Penya
The package doesn't work if I have multiple projects. dotnet pack just packs a single project. It doesn't pack all of its project...
Read more >
Dotnet pack automatic package versioning doesn't work ...
The created NuGet package will have the default version of `1.0.0`. When the `Pack option` `Use an environment variable` is set to `Build....
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