in ILRepack/RepackImporter.cs [677:706]
private bool DuplicateTypeAllowed(TypeDefinition type)
{
string fullName = type.FullName;
// Merging module because IKVM uses this class to store some fields.
// Doesn't fully work yet, as IKVM is nice enough to give all the fields the same name...
if (fullName == "<Module>" || fullName == "__<Proxy>")
return true;
// XAML helper class, identical in all assemblies, unused within the assembly, and instanciated through reflection from the outside
// We could just skip them after the first one, but merging them works just fine
if (fullName == "XamlGeneratedNamespace.GeneratedInternalTypeHelper")
return true;
// Merge should be OK since member's names are pretty unique,
// but renaming duplicate members would be safer...
if (fullName == "<PrivateImplementationDetails>" && type.IsPublic)
return true;
if (_options.AllowedDuplicateTypes.Contains(fullName))
return true;
var top = type;
while (top.IsNested)
top = top.DeclaringType;
string nameSpace = top.Namespace;
if (!String.IsNullOrEmpty(nameSpace) && _options.AllowedDuplicateNameSpaces.Any(s => s == nameSpace || nameSpace.StartsWith(s + ".")))
return true;
return false;
}