-
Notifications
You must be signed in to change notification settings - Fork 1.1k
'PackageVersion' is reset to '1.0.0' #1557
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
Comments
@iSazonov Can you provide a simple repro demonstrating the issue? By immediately redefined, do you mean also in NuGet.targets? |
On next Monday I'll try to make it.
Yes, in log file I see that just after the task complete 'PackageVersion' is assigned to '1.0.0' |
I attach a file with simple repo. |
The problem is that Version is being set in a target. During static evaluation before any targets are run, a default value of Version = 1.0.0 is picked and that flows to PackageVersion default (also during static evaluation). If you change either of these after evaluation in a target, there is no magic way for it to impact the other property. This comment is inaccurate: <!--
We have explicitly assign 'PackageVersion'
because there is a bug: 'PackageVersion' is correctly assigned as 'Version' in 'NuGet.targets'
but then immediately redefined as '1.0.0'. It should be something like this: <!--
We have to explicitly assign 'PackageVersion' here because we're changing 'Version' in a target. Before any targets
have run (during static evaluation), 'Version' will have defaulted to '1.0.0' and PackageVersion will have defaulted to
'Version'. So we must update both 'Version' and 'PackageVersion' here. This isn't a bug as there's no way to make PackageVersion a dynamic property that automatically changes when Version changes dynamically in a target. |
@nguerrera Thanks for clarify. |
Add documentation of why `PackageVersion` is used in `PowerShell.Common.props`. Explamation is copied from [dotnet/sdk](dotnet/sdk#1557 (comment)) Co-Authored-By: Nick Guerrera <nicholg@microsoft.com>
In PowerShell Core repo we have explicitly assign 'PackageVersion' because there is a issue: in debug file, we can see that 'PackageVersion' is correctly assigned as 'Version' in 'NuGet.targets' but then immediately redefined as '1.0.0'.
The text was updated successfully, but these errors were encountered: