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

Resolve dependencies from GAC #951

Merged
merged 1 commit into from
Aug 30, 2021
Merged

Conversation

Haplois
Copy link
Contributor

@Haplois Haplois commented Aug 30, 2021

Cherry-picked from #950

When there are dependencies that the project installs, but they would only resolve via a reference that is located in GAC (e.g. System.ValueTuple via netstandard) then the deployment into Out folder would ignore it.

If user then installs a version that is newer than what is in GAC it will get into their assembly redirects, but won't get copied into Out folder, resulting into TypeLoad exception for tests with DeploymentItem attribute.

This change fixes the resolver to look through all the dependencies including GAC dependencies and then copy over only the ones that are found in the bin folder, because ultimately Out should be just a subset (or the same) as the contents in bin folder.

Looking through GAC assemblies does not seem to add significant overhead the whole resolve is under 300ms so hopefully we don't need an option to configure enabling this.

(The new log messages won't go into diag log, because it probably is not correctly initialized in the new appdomain that loads the dll, but they will be written to Debug Trace and can be observed by DebugView++ or DebugView.)

@Haplois Haplois enabled auto-merge (squash) August 30, 2021 12:12
@Haplois Haplois disabled auto-merge August 30, 2021 12:16
@Haplois Haplois enabled auto-merge (squash) August 30, 2021 12:17
@Haplois Haplois merged commit b86a8fb into pre/2.2.7 Aug 30, 2021
@Haplois Haplois deleted the nohwnd--copy-gac-deps-from-bin branch August 30, 2021 13:00
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.

2 participants