Make sure you're using the latest version of Cecil from GitHub<https://github.com/jbevain/cecil> . I haven't seen these methods (and some of the types) on the stack trace before (although I've been using Cecil for some time), so I assume they are your custom additions.
But then, we cannot help you unless you give us some source code. I mean, hey, all we've got is a bunch of unknown types and methods to figure out what's wrong. Sorry, I don't think any of us is _that_ good. :) 2011/5/25 Paul Buonopane <[email protected]> > When I try to inject a type that contains any sort of dynamic code, I > receive the following error: > > System.ArgumentOutOfRangeException: Index was out of range. Must be > non-negative and less than the size of the collection. > > Parameter name: index > > at > System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 > index) > > at Mono.Cecil.GenericParameterCollection.get_Item(Int32 index) > > at Mono.Cecil.DefaultImporter.GetGenericParameter(GenericParameter gp, > ImportContext context) > > at Mono.Cecil.DefaultImporter.ImportTypeReference(TypeReference t, > ImportContext context) > > at Mono.Cecil.DefaultImporter.ImportFieldReference(FieldReference fr, > ImportContext context) > > at Mono.Cecil.ImportContext.Import(FieldReference field) > > at Mono.Cecil.Cil.MethodBody.Clone(MethodBody body, MethodDefinition > parent, ImportContext context) > > at Mono.Cecil.MethodDefinition.Clone(MethodDefinition meth, > ImportContext context) > > at Mono.Cecil.TypeDefinition.Clone(TypeDefinition type, ImportContext > context) > > at Mono.Cecil.ModuleDefinition.ImportTypeDefinition(TypeDefinition type, > ImportContext context) > > at Mono.Cecil.ModuleDefinition.Inject(TypeDefinition type, IImporter > importer) > > at Mono.Cecil.ModuleDefinition.Inject(TypeDefinition type) > > -- > -- > mono-cecil -- -- mono-cecil
