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.
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:
System.Object
.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.