Skip to content
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

PackageVersion property for .NET Core projects #1146

Merged
merged 1 commit into from
Jan 25, 2017

Conversation

alpaix
Copy link
Contributor

@alpaix alpaix commented Jan 25, 2017

Resolves NuGet/Home#3901.

Acquire package version property for a .NET Core project from the
IVsProjectRestoreInfo as provided via the Nominate API call.

Although the $(PackageVersion) property shouldn't differ between
different TFMs current API design assumes all project properties will be
evaluated per each TFM.

As a result SolutionRestoreService expects to get the
same value of package version defined in each TFM property bag.
Otherwise InvalidOperationException will be thrown.

//cc @emgarten @jainaashish @mishra14 @rohit21agrawal @natidea @rrelyea

.Cast<IVsTargetFrameworkInfo>()
.Select(tfm => GetPropertyValueOrNull(tfm.Properties, propertyName))
.Distinct()
.SingleOrDefault();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say this is the most correct, but will it be too difficult for the user to figure out if this silently returns null and 1.0.0 is used as the project version?

Copy link
Member

@emgarten emgarten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one question on if there should be a warning displayed.

Resolves NuGet/Home#3901.

Acquire package version property for a .NET Core project from the
`IVsProjectRestoreInfo` as provided via the Nominate API call.

Although the `$(PackageVersion)` property shouldn't differ between
different TFMs current API design assumes all project properties will be
evaluated per each TFM.

As a result `SolutionRestoreService` expects to get the
same value of package version defined in each TFM property bag.
Otherwise `InvalidOperationException` will be thrown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants