NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): VS UI
NuGet version (4.9.0):
dotnet.exe --version: 2.1.4
VS version: 2017.9.2
Worked before? If so, with which NuGet version: No
Expected:
They should be created with Package Version 5.0.0-alpha1. Visual Studio shows this version in the "Package" UI. See System.Waf.Core project.
Note:
The package version is defined by the AssemblyInformationVersionAttribute instead of the PackageVersion MSBuild property.
The package version is not generated with the AssemblyInformationVersionAttribute property.
If you look at the targets here, there's no mention of it
https://github.com/NuGet/NuGet.Client/blob/release-4.9.1-rtm/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets
You need to use PackageVersion.
It is inconsistent with
AssemblyInformationVersionAttribute.
Same issue with Package Description and the AssemblyDescriptionAttribute.
@jbe2277
That looks like an issue in the UI, which is not handled directly by NuGet.
The expectation by pack is that the PackageVersion/Version are used.
Please refer to https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets for more details.
In the meantime, consider using PackageVersion and Description in some of the directory.build.props through your project.
//cc @NuGet/nuget-client @cartermp
Did you find a solution for that? i think that you should move your issue to Visual Studio github repository issues. it is not probably related to Nuget but more Visual Studio and msbuild
quick solution here. just right click on your project file and edit it. there 2 versions
<PackageVersion>1.0.1</PackageVersion>
and
<Version>1.0.1</Version>
Looks like PackageVersion is used to generate nuget version but VS settings are updating Version tag. I have no idea what is it for. It still an issue with VS and please move it to VS issues.
I discovered this bug (and the "edit the csproj file manually" workaround) a while back. I agree that it's a VS UI issue. So if this GH issue tracker isn't responsible for the UI, then have we raised this in the VS Issue Tracker?
Thanks for tagging @nkolev92 - this should go under https://github.com/dotnet/project-system
I don't have permissions to move the issue though
I've raised an Issue over on project system:
https://github.com/dotnet/project-system/issues/5678
Wehn I tested this in detail. I found that the Pack-on-build functionality, does use the <Version> tag ... but only if the <PackageVersion> tag is entirely absent.
If they're both present then it uses \
So if you create a blank project, and never manually edit the .csproj, it should all work I think.
Not sure how my projects came to have a \
So I suppose that they could argue that the UI is doing what it's supposed to, and that the Packer is bugged (in that \
Thanks @cartermp and @Brondahl
Closing this as external.
Most helpful comment
quick solution here. just right click on your project file and edit it. there 2 versions
<PackageVersion>1.0.1</PackageVersion>and
<Version>1.0.1</Version>Looks like PackageVersion is used to generate nuget version but VS settings are updating Version tag. I have no idea what is it for. It still an issue with VS and please move it to VS issues.