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

Handle multi-targeted projects in UnusedReferencesRemover #51347

Merged
merged 2 commits into from
Feb 21, 2021

Conversation

JoeRobich
Copy link
Member

When building our list of references, we add the compilation assemblies from each used target. When building our list of used compilation assemblies, we add the used assemblies from all projects with the same path (each target gets their own project instance). When determine if a reference is used, we consider it used if even one targets compilation assembly is used.

implements part of #50054

@JoeRobich JoeRobich requested a review from a team as a code owner February 19, 2021 23:12
Copy link
Contributor

@ryzngard ryzngard left a comment

Choose a reason for hiding this comment

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

Minor feedback. Overall looks good

var projects = solution.Projects
.Where(project => projectFilePath.Equals(project.FilePath, System.StringComparison.OrdinalIgnoreCase));

HashSet<string> usedAssemblyFilePaths = new();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: have we decided we're using this instead of var usedAssemblyFilePaths = new HashSet<string>()?

@JoeRobich JoeRobich force-pushed the handle-multi-targeting branch from b5300c7 to 9d83e12 Compare February 20, 2021 23:01
@JoeRobich JoeRobich force-pushed the handle-multi-targeting branch from 9d83e12 to 8f9c650 Compare February 21, 2021 01:56
@JoeRobich JoeRobich merged commit 0a2c866 into dotnet:release/dev16.10 Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants