hi kevin! since i am working on a quite similar piece of software, i have a question: what do you mean by touching? is e.g. "customAttribute.ConstructorArguments.Count" enough? or do i really have to touch every single value by hand?
thank you! On 28 Feb., 00:33, Kevin Jones <[email protected]> wrote: > Jb, > > Thanks for the insight. Touching the Attribute's constructor values > appeared to resolve the issue. > > Many thanks, > -- Kevin J. > > On Feb 27, 5:41 pm, Jb Evain <[email protected]> wrote: > > > Hi Kevin, > > > Thanks for the fantastic repro. > > > On Sun, Feb 27, 2011 at 11:01 PM, Kevin Jones <[email protected]> wrote: > > > Thanks for taking your time to look at this. > > > So, the issue is indeed due to how custom attributes are encoded, for > > types, as a plain string. For speed reason, Cecil when roundtripping > > an assembly, doesn't deserialize custom attributes before serializing > > them back, but simply copy their byte[] value over to the new > > assembly. > > > In your case, it's enough to load the CustomAttributes of the types. > > For instance, if you make sure you access the .ConstructorArguments of > > the CustomAttribute on SomeType, your test will pass. I'm afraid > > you'll indeed have to force yourself the load of the attributes > > content. There's currently no helper method in Cecil to ease that. > > > Jb > > -- -- mono-cecil
