Dependent packages version numbers are not updated correctly.
See original GitHub issuefrom @niemyjski at https://github.com/dotnet/cli/issues/5596
I was running my build with dotnet build -f net46 Foundatio.sln /p:VersionPrefix="$($env:APPVEYOR_BUILD_VERSION)" /p:VersionSuffix="$($env:VERSION_SUFFIX)"
to update the predefined version properties (https://github.com/exceptionless/Foundatio/blob/73b8ee68d611d1521e48eadac1101ea054115e6c/build/version.props). This seemed to create the nuget packages with the correct version numbers but I noticed that packages (project references) didn’t have the correct version numbers.
You can see it here (https://www.nuget.org/packages/Foundatio.Redis/4.3.1280), once I started updating the version.props file on disk as a pre build task and stopped updating the properties as a parameter the issue went away as you can see here https://www.nuget.org/packages/Foundatio.Redis/4.3.1282
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
As far as dependent packages are concerned,
Pack
reads the project references version from the assets file. So whatever is written out to the assets file is what is written out in the output nuspec as well. @neilhuiz gave the right way to get the right package versions for your project references.Since it’s a bit hidden, @niemyjski’s project uses the
<GeneratePackageOnBuild>
feature.That feature comes from the NuGet.Build.Tasks.Pack package [so the issue belongs in the NuGet repo] but I took a quick look and found:
Note the second clause of the condition. This only triggers when we’re doing an
outer build
which has two implications:-f
is specified then I’d not expect the packages to be produced. Are we sure we’re not seeing packages from some other build?We’ll need to run a
/v:diag
build to see what’s really going on…