Hi, On Tue, Nov 15, 2011 at 6:09 PM, [email protected] <[email protected]> wrote: > I've been reading https://github.com/mono/cecil/tree/master/merge/Mono.Merge > and I'm close to understanding it but I feel im missing something > rather simple... > > How can I copy a type from one assembly to another, currently I'm > doing this: > > var t = assemblyDefA.MainModule.GetType("some name"); > assemblyDefB.MainModule.Types.Add(t); > > but I get "Type already attached". > > How can I achieve this?
(Sadly?) There's no easy way to move one type from a module to another, as it involves taking a lot of decisions about what to do with references. Also Mono.Merge is completely dead. I suggest you look at http://code.google.com/p/il-repack/ Jb -- -- mono-cecil
