Iterating through the MethodDef

foreach (TypeDefinition typeDefinition in
assemblyDefinition.MainModule.Types)
                        {
                                foreach (MethodDefinition methodDefinition in
typeDefinition.Methods)
                                {
                                        if(methodDefinition.HasCustomAttributes)
                                        {
                                              //Check for
Customattribute name and Do something..
                                        }
                               }
                       }

So putting a breakpoint for my property name , hits the foreach loop
for the method definition, but doesn't go inside the if condition, as
it returns false for HasCustomAttributes.  And I have checked, my
custom attribute is targeted to Method and Property both.

Thanks,

On Jul 25, 10:29 am, Jb Evain <[email protected]> wrote:
> Hi,
>
> On Mon, Jul 25, 2011 at 6:07 PM, deedee <[email protected]> wrote:
> > Am I doing something wrong here?
>
> It depends I guess, you'd have to show some code.
>
> Jb

-- 
--
mono-cecil

Reply via email to