I’m new to Cecil and I created a simple test. It renames all namespaces/types to random strings.
var assembly = AssemblyDefinition.ReadAssembly(@"C:\somexe.exe");
foreach (var t in assembly.MainModule.Types) {
t.Namespace = Guid.NewGuid().ToString();
t.Name = Guid.NewGuid().ToString();
}
After starting the executable runs, but with empty form (it’s winforms).
I thought CLR doesn’t care about names? What I shouldn’t rename? Or I’m doing something else wrong?
A lot of things, esecially in winforms, rely on reflection. And reflection cares very much about names. This could also relate to resources, and a resource file not matching up. Also, a lot of attributes may include type information as strings, which can impact things. As can serialization (BinaryFormatter in particular).
However, without more context (mainly: code), we can only guess.