Hi, Jb,

I don't know it would fail before accessing it, right?
Even I know one of ConstructorArguments cannot be resolved, then how
can I access other ConstructorArguments(or Perperties and Fields)?

If I just want to read the value, don't care about the type, is it
possible?
For example, [DefaultValue(0)] <- here 0 is enum which cannot be
resolved.
I can get TypeReference of the enum type, it's ok for me, but how to
get the value 0 without resolve it?

Regards
Wicky

On Aug 5, 10:56 pm, Jb Evain <[email protected]> wrote:
> Hey,
>
> On Thu, Aug 5, 2010 at 4:23 PM, Wicky <[email protected]> wrote:
> > Is it possible to just read the object value into
> > CustomAttributeArgument.Value without any error?
>
> Nope, it's not. If you can't resolve the assembly defining the
> attribute, don't access its .ConstructorArguments or
> .Properties/.Fields collections. Cecil will keep the attribute
> unresolved and will be able to serialize it back.
>
> --
> Jb Evain  <[email protected]>

-- 
--
mono-cecil

Reply via email to