private Object ResolveAssemblyReference(AssemblyReferenceHandle handle) { AssemblyReference assemblyReference = _metadataReader.GetAssemblyReference(handle); AssemblyName an = new AssemblyName(); an.Name = _metadataReader.GetString(assemblyReference.Name); an.Version = assemblyReference.Version; var publicKeyOrToken = _metadataReader.GetBlobBytes(assemblyReference.PublicKeyOrToken); if ((assemblyReference.Flags & AssemblyFlags.PublicKey) != 0) { an.SetPublicKey(publicKeyOrToken); } else { an.SetPublicKeyToken(publicKeyOrToken); } an.CultureName = _metadataReader.GetString(assemblyReference.Culture); an.ContentType = GetContentTypeFromAssemblyFlags(assemblyReference.Flags); var assembly = _moduleResolver.ResolveAssembly(an, throwIfNotFound: false); if (assembly == null) { return(ResolutionFailure.GetAssemblyResolutionFailure(an.Name)); } else { return(assembly); } }
ModuleDesc IModuleResolver.ResolveAssembly(AssemblyName name, bool throwIfNotFound) { if (name.Name == _canonModuleName.Name) { return(_canonModule); } else { return(_wrappedResolver.ResolveAssembly(name, throwIfNotFound)); } }