You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of AssemblyResolverBase uses its IList<string> SearchDirectories property to probe for assemblies matching the name provided by an AssemblyDescriptor. This search directories property is populated automatically with string ModuleDefinition::FilePath if it is not null or empty.
The FilePath property is only set when using ModuleDefinition.FromFile, but not when using any of the other FromXXX methods. This means the default assembly resolver does not know anything about the file location of the input binary, and thus also not any of its dependencies.
Proposal
Populate AssemblyResolverBase::SearchDirectories with ModuleReaderParameters::WorkingDirectory when not-null and/or are read from a source different than a file on the disk.
Alternatives
The user can manually add the working directory to the current AssemblyResolverBase instance. This, however, is a bit hidden behind ModuleDefinition::MetadataResolver::AssemblyResolver, and requires up-casting since AssemblyResolverBase is not the type that is directly exposed, making this process unintuitive.
Additional Context
string WorkingDirectory property is currently only used by the DefaultNetModuleResolver to resolve sub-modules of multi-module assemblies.
The text was updated successfully, but these errors were encountered:
Problem Description
The implementation of
AssemblyResolverBase
uses itsIList<string> SearchDirectories
property to probe for assemblies matching the name provided by anAssemblyDescriptor
. This search directories property is populated automatically withstring ModuleDefinition::FilePath
if it is not null or empty.The
FilePath
property is only set when usingModuleDefinition.FromFile
, but not when using any of the otherFromXXX
methods. This means the default assembly resolver does not know anything about the file location of the input binary, and thus also not any of its dependencies.Proposal
Populate
AssemblyResolverBase::SearchDirectories
withModuleReaderParameters::WorkingDirectory
when not-null and/or are read from a source different than a file on the disk.Alternatives
The user can manually add the working directory to the current
AssemblyResolverBase
instance. This, however, is a bit hidden behindModuleDefinition::MetadataResolver::AssemblyResolver
, and requires up-casting sinceAssemblyResolverBase
is not the type that is directly exposed, making this process unintuitive.Additional Context
string WorkingDirectory
property is currently only used by theDefaultNetModuleResolver
to resolve sub-modules of multi-module assemblies.The text was updated successfully, but these errors were encountered: