How can I remove all DebuggerHiddenAttribute from the assembly only if the compiler generated this attribute?
I am trying to use this code, but it does not work.
ModuleDefinition module = ...;
MethodDefinition targetMethod = ...;
MethodReference attributeConstructor = module.Import(
typeof(DebuggerHiddenAttribute).GetConstructor(Type.EmptyTypes));
targetMethod.CustomAttributes.Remove(new CustomAttribute(attributeConstructor));
module.Write(...);
Thanks in advance.
source
share