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

Enhance assembly name reference and system type resolution #929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DenisKudelin
Copy link

@DenisKudelin DenisKudelin commented Nov 12, 2023

This commit refines the system type import functionality in Mono.Cecil to ensure that system types are resolved efficiently and do not introduce unnecessary assembly references. By aligning the import logic with the assembly containing the built-in System.Object type, the mechanism now avoids importing types from system assemblies that the running assembly already references.

Key changes you'll find in this commit:

  • The TryGetAssemblyNameReference method has been updated to prevent importing system types from outside the core system assembly (e.g., mscorlib or System.Private.CoreLib) if a type belongs to the same assembly as System.Object.
  • The TryGetAssemblyNameReference method has been improved to handle both direct and forwarded assembly references with greater precision.

These changes contribute to a leaner import process, eliminating redundant assembly references and adhering to the common developer expectations regarding system type resolution in .NET environments.

@DenisKudelin DenisKudelin changed the title Enhance assembly name reference resolution in ModuleDefinition Enhance assembly name reference and system type resolution Nov 14, 2023
@DenisKudelin DenisKudelin force-pushed the transitive-dependency-fix branch 7 times, most recently from eee01b0 to e7647d2 Compare November 15, 2023 08:08
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.

None yet

1 participant