简体   繁体   中英

Changing internal class to public (CIL, Mono.Cecil)

Is there a way to get interclass's type via CIL and change It to public?

AssemblyDefinition x = AssemblyDefinition.ReadAssembly("x.dll");
TypeDefinition type = x.MainModule.GetType("Class");
AssemblyDefinition adef = AssemblyDefinition.ReadAssembly("x.dll");
TypeDefinition tdef = adef.MainModule.GetType("Class");
tdef.IsPublic = true;
adef.MainModule.Write("x_updated.dll");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM