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

Set PackageValidationBaselineName to assemblyName when packageID is not set #18658

Merged
merged 5 commits into from
Jul 1, 2021
Merged

Set PackageValidationBaselineName to assemblyName when packageID is not set #18658

merged 5 commits into from
Jul 1, 2021

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Jul 1, 2021

Fixes issue in dotnet/runtime#54250

@Anipik Anipik requested review from ViktorHofer and safern July 1, 2021 06:14
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ViktorHofer
Copy link
Member

In which cases is PackageId not set?

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
@Anipik
Copy link
Contributor Author

Anipik commented Jul 1, 2021

In which cases is PackageId not set?

Its being set late during the sdk evaluation.

@ViktorHofer
Copy link
Member

Its being set late during the sdk evaluation.

Doesn't that mean that PackageId is never used then?

@Anipik
Copy link
Contributor Author

Anipik commented Jul 1, 2021

Doesn't that mean that PackageId is never used then?

unless its a global property

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
@ViktorHofer
Copy link
Member

unless its a global property

which is never the case usually.

@Anipik
Copy link
Contributor Author

Anipik commented Jul 1, 2021

which is never the case usually.

setting the packageID in the csproj would be another scenario.

@ViktorHofer
Copy link
Member

ViktorHofer commented Jul 1, 2021

setting the packageID in the csproj would be another scenario.

That's also very rarely the case for projects unless they would want to override it.

You could easily avoid this sequencing issue by inlining the PackageValidationBaselineName value into the two locations where it's used:

  • The PackageDownload item
  • In the task as a property later

By inlining it, you will only access the PackageId value after it is set by NuGet. And with that you can then remove the AssemblyName fallback scenario as well.

@ViktorHofer
Copy link
Member

LGTM module the one remaining feedback item.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
@Anipik Anipik merged commit 471e20e into dotnet:main Jul 1, 2021
v-wuzhai pushed a commit that referenced this pull request Apr 22, 2024
ViktorHofer pushed a commit that referenced this pull request May 7, 2024
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.

3 participants