If you only want to add an assembly reference just add a new AssemblyNameReference to the module.AssemblyReferences collection.
The ImportReference methods are used to create reference for members accross modules. On Tue, Dec 12, 2017 at 3:22 PM, John Smith <[email protected]> wrote: > Unfortunately none of those methods accepts a reference to an assembly > definition or an assembly name. > > > On Tuesday, December 12, 2017 at 11:05:50 AM UTC-6, Jb Evain wrote: >> >> It's through the entire ModuleDefinition.ImportReference methods. >> >> On Mon, Dec 11, 2017 at 5:41 PM, John Smith <[email protected]> wrote: >> >>> >>> I'm trying to inject some IL code into an assembly, and that code is >>> dependent on types from an external assembly. What's the recommended way of >>> adding a reference to that assembly into the target assembly? >>> >>> -- >>> -- >>> -- >>> 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. >>> >> >> > -- > -- > -- > 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. > -- -- -- 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.
