How can I remove all DebuggerHiddenAttribute from an assembly only if the compiler generated this attribute?
I'm trying this code, but it doesn't 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.