bool TryGetAssemblyNameReference(SR.AssemblyName name, out AssemblyNameReference assembly_reference) { var references = module.AssemblyReferences; var pkt = name.GetPublicKeyToken(); for (int i = 0; i < references.Count; i++) { var reference = references [i]; if (name.Name != reference.Name || (pkt != null && pkt.Equals(reference.PublicKeyToken))) // TODO compare field by field continue; assembly_reference = reference; return true; } assembly_reference = null; return false; }