Closed GoogleCodeExporter closed 8 years ago
Here's an inefficient but working fix - In Obfuscar.cs, RenameType(), after the
first
foreach, add this :
foreach (TypeDefinition typeDef in info.Definition.MainModule.Types)
{
foreach (CustomAttribute attrib in typeDef.CustomAttributes)
{
for (int i = 0; i < attrib.ConstructorParameters.Count; i++)
{
string str;
if (!string.IsNullOrEmpty(str =
attrib.ConstructorParameters[i] as string) &&
str == string.Format("{0}.{1}", type.Namespace,
type.Name))
{
attrib.ConstructorParameters[i] = newTypeKey.Fullname;
}
}
}
}
Original comment by silve...@gmail.com
on 22 Jul 2009 at 10:47
I made a fix for that, which is part of version 1.5 now.
It uses a lookup dictionary, so it should be more efficient.
Additionally it works on types from other assemblies and on property and field
initializers in attribute constructors.
Original comment by webbi...@gmail.com
on 6 Nov 2009 at 3:05
Original issue reported on code.google.com by
silve...@gmail.com
on 21 Jul 2009 at 3:02Attachments: