且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何删除所有DebuggerHiddenAttribute

更新时间:2023-12-05 17:19:46

这实际上是不可能的.在已编译程序集中定义的属性是不可变的.您不能在不复制整个程序集的情况下进行更改.

This is not really possible. The attributes defined in a compiled assembly are immutable. You can't change them without reproducing the entire assembly.

在这个特定的答案中,当您调用Remove时,它是在CustomAttributes属性返回的数组上被调用的.它将从数组中删除它,而不是从程序集上的元数据中删除它

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