I'm trying to add an assembly reference to a module using the following 
code, and it ends up with more than one assembly references having the same 
MetadataToken value; any ideas what might be wrong?

        public static IMetadataScope Import(this ModuleDefinition target, 
> AssemblyNameReference assembly)
>         {
>             var res = target.AssemblyReferences.FirstOrDefault(cur => 
> cur.FullName.Equals(assembly.FullName));
>             if (res != null)
>                 return res;
>
>             res = new AssemblyNameReference(assembly.Name, 
> assembly.Version)
>             {
>                 PublicKeyToken = assembly.PublicKeyToken,
>             };
>             target.AssemblyReferences.Add(res);
>             return res;
>         }
>
>

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mono-cecil/8dd4db87-1c32-4de9-915f-d03550f537d2%40googlegroups.com.

Reply via email to