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

Provide a way for custom steps to resolve assemblies #2073

Closed
sbomer opened this issue Jun 1, 2021 · 0 comments · Fixed by #2074
Closed

Provide a way for custom steps to resolve assemblies #2073

sbomer opened this issue Jun 1, 2021 · 0 comments · Fixed by #2074

Comments

@sbomer
Copy link
Member

sbomer commented Jun 1, 2021

Xamarin-macios uses reflection to get a linker method that loads assemblies:

https://github.com/xamarin/xamarin-macios/blob/882dde132a0b893c1e929969d7472e93ec7745c8/tools/dotnet-linker/Steps/CollectAssembliesStep.cs#L19

We should provide some way to load new assemblies so that reflection isn't required here. I think rather than making GetReferencedAssemblies public we should give custom steps more granular control over individual assembly resolution. Maybe we could make AssemblyResolver public, or implement IAssemblyResolver on LinkContext. The latter would nicely match what we did with IMetadataResolver.

sbomer added a commit to sbomer/linker that referenced this issue Jun 2, 2021
sbomer added a commit that referenced this issue Jun 8, 2021
* Implement IAssemblyResolver for LinkContext

Fixes #2073

* Fix using order

* Don't implement IAssemblyResolver
agocke pushed a commit to dotnet/runtime that referenced this issue Nov 16, 2022
* Implement IAssemblyResolver for LinkContext

Fixes dotnet/linker#2073

* Fix using order

* Don't implement IAssemblyResolver

Commit migrated from dotnet/linker@802aa45
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 a pull request may close this issue.

1 participant