> Am really sorry, but the code snippet you posted doesn't make sense :)
Haha, ok :D

> If you have an AssemblyBuilder, you already have control over what
> you're emitting. Why would you want to modify it Cecil ? You can just
> emit what you want in a first place.
I simply want to use the support for parsing and replacing
instructions, since all System.Reflection offers is a byte array. I
can parse it myself, of course, but Cecil is more convenient.

In a semi-unrelated question: how do you create a type with Cecil? I'd
like to take a pre-existing type and create a type that extends it
(i.e., a subclass). I don't want to replace the pre-existing type or
the assembly, nor write the assembly to disk. Is it possible?

On May 4, 3:51 pm, Jb Evain <[email protected]> wrote:
> On Tue, May 4, 2010 at 3:40 PM, Alix <[email protected]> wrote:
> > Well, I'm creating it. I have an AssemblyBuilder, in case that
> > helps :)
> > It's just not finalized.
>
> Cecil can not interact with an assembly created by an AssemblyBuilder
> until the Assembly has been saved to the disk. This means that you can
> not alter an AssemblyBuilder with Cecil, as the AssemblyBuilder will
> be loaded in the runtime anyway.
>
> Am really sorry, but the code snippet you posted doesn't make sense :)
>
> If you have an AssemblyBuilder, you already have control over what
> you're emitting. Why would you want to modify it Cecil ? You can just
> emit what you want in a first place.
>
> --
> Jb Evain  <[email protected]>
>
> --
> --
> mono-cecil

-- 
--
mono-cecil

Reply via email to