This is not really possible. The attributes defined in a compiled assembly are immutable. You can't change them without reproducing the entire assembly.
In this particular answer when you call Remove
it is being called on an array returned by the CustomAttributes
property. It will remove it from the array, not from the metadata on the assembly