Hi,

In that case the value of the first and only constructor argument
should be an array of CustomAttributeArgument, each of them with a
Type of String and a Value being the actual string value you're
interested in.

Jb

On Fri, Jan 31, 2014 at 4:08 PM, Rinat Sadretdinow
<[email protected]> wrote:
> Hello community!
>
> I cannot figure how can I obtain values of method custom attributes. I use
> following (some primitive for simplicity):
>
>     MethodDefinition md = /* defined some earlier) */
>     foreach (CustomAttribute ca in md.CustomAttributes)
>     {
>         Console.WriteLine(ca.IsResolved); // always says 'False'
>         Console.WriteLine(ca.Properties.Count); // always 0
>         Console.WriteLine(ca.Fieldss.Count); // always 0
>         Console.WriteLine(ca.HasConstructorArguments); // says 'True'
>
>         foreach (CustomAttributeArgument caa in ca.ConstructorArguments)
>         {
>             Console.WriteLine(caa.Value.ToString()); // always returns an
> empty string
>         }
>     }
>
> I'm ABSOLUTELY sure that the mathod custom attributes set as
>
>     [CachedOptimizedCode(new string[]
>     {
>         "__name__",
>         "__file__",
>         "__doc__",
>         "__path__",
>         "__builtins__",
>         "__package__",
>
>         ....
>
>     }
>
> Yes, it is IronPhyton generated DLL. And yes, I have neither source nor
> anything, just generated DLL.
>
> Any ideas what I do wrong?
>
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to