.net postsharp编译时生成的代码?

最近下载了postsharp,发现给方法添加[HandleException] attribute后,反编译后自动生成了很多代码,思考了很久,还是不知道在编译该程序集时,怎么生成的,所以希望大家能给与指点。

原类

public class MyClass {

    public MyClass()     {     }

    [HandleException]    

public int MyMethod(int x, string someString, float anotherFloat, bool theBool)    

    {

          int b = 0;

           int a = 5 / b;         return x + 1;    

     }

}

编译后,用ILSPY反编译后生成如下代码:

望 各位大神能给与指点,谢谢。

posted on 2013-08-21 21:19  Roc-Lee  阅读(467)  评论(2编辑  收藏  举报

导航