Thanks for the pointer...that seems to have moved me to my next errors :-) Is there any good example of using Cecil to emit an assembly/module/Type from scratch? My current MO is to create a simple example DLL in C#, open it with Cecil to inspect it, and then try to duplicate it via Cecil in my F# repl. So far I'm not really having any success. Either Cecil throws an exception or sometimes it just emits an empty assembly(without a simple type I'm trying to create).
Previously my MO was to try using Cecil along with Serge Lidin's "Expert .Net 2.0 IL Assembler", but the differences in Cecil's API to pure textual IL is too much for my mind to compensate. Any pointers would be appreciated. Mike Kohout On Thu, Jan 7, 2010 at 5:50 AM, Jb Evain <[email protected]> wrote: > Hi Michael, > > On Tue, Jan 5, 2010 at 8:14 AM, Michael Kohout <[email protected]> wrote: > > at Mono.Cecil.ModuleDefinition.Inject(TypeDefinition type) > > at <StartupCode$FSI_0003>.$FSI_0003.main@() in C:\Users\Michael > > Kohout\Documents\CecilCompiler\CecilCompiler\Script.fsx:line 22 > > Don't call Inject to add a type to an assembly. Just add it to the > .Types collection on the module. Inject was meant to inject a type > from an assembly to another, but it's too simplistic to be used in > real cases. > > -- > Jb Evain <[email protected]> > > -- > -- > mono-cecil >
-- -- mono-cecil
