-
Notifications
You must be signed in to change notification settings - Fork 253
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
/t:Pack /p:Version not handling dependency versions #5371
Comments
@dazinator you need to pass the same additional parameters to restore and build.
Pack reads version and dependency information from project.assets.json which is created by restore. Going forward this will be fixed in dotnet CLI 2.0.0, pack will automatically call restore with the same properties. |
@emgarten What about the following scenario:
Will the restore happen correctly between the build and the pack so that the newly updated version will correctly be picked up? |
@bording no, dependency packages are not allowed to change the identity of the project being restored or it's dependencies since this would cause the 2nd restore to give different results than the first restore. GitVersioning is a common request, we're looking at ways for packages to plug in and contribute before restore to solve this. |
@emgarten Thanks, I'll follow that issue for additional progress. This is definitely an important scenario to support! |
also, closing this as dupliacte of : #4337 |
From @dazinator on June 8, 2017 14:8
Given a solution with two projects, "Foo.csproj" with a project reference to "Bar.csproj"
When doing an
msbuild My.sln /t:Pack /p:Version="1.0.0-alpha"
Foo produces a nuget package version "1.0.0-alpha"
Bar produces a nuget package version "1.0.0-apha"
Inside the nuget package for
Foo
is a nuspec file, withBar
listed as a dependency (correct). The version of that dependency shows as1.0.0
. This is incorrect. When these nuget packages are published to a feed, andFoo
is then installed by a client - the client will complain thatBar
version1.0.0
doesn't exist on the feed, or perhaps it does exist by coincidence and it will be downloaded even though it's not actually the correct version for the dependency.The dependency package (
bar
) was produced with a Version number, and therefore when a dependency element is generated infoo
's nuspec, for the 'bar' package, that element should honour that version number, not be left as 1.0.0 which is incorrect.Do you have any other suggestions as to how to overcome this limitation in the short term? Perhaps there is something I am missing? I would prefer not to have to manually create and maintain nuspec files to fix this as that's quite a big overhead for some of our solutions that have upwards of 50 projects each.
Copied from original issue: dotnet/sdk#1320
The text was updated successfully, but these errors were encountered: