Hello, Has there been any improvements/suggestions around this since this last thread post, by chance? I am dynamically creating an assembly via Roslyn, then reading it into Cecil with a MemoryStream via AssemblyDefinition.ReadAssembly. When I Remove the Type from its original (Roslyn) module definition, and then Add it to the created Cecil module definition, it does work, but I do end up getting a "Specified method is not supported." exception when the module writes out.
Thanks for any insight you can provide. I have a sinking feeling that I think I'm just going to have to learn IL after all. :P Michael On Tuesday, November 15, 2011 12:09:55 PM UTC-5, [email protected] wrote: > > Hi, > > 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? > > Thanks! -- -- -- mono-cecil --- You received this message because you are subscribed to the Google Groups "mono-cecil" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
