Hi Bert, It's a matter of the type system that you use to create references.
If you use ImportReference on a System.Type/System.Reflection.MethodInfo for instance, Cecil will have to use the one that is of the project doing the patching. Which is what I suspect you're doing. You need to use the Cecil type system and ImportReference from TypeDefinition/MethodDefinition defined in other assemblies. For primitive types, you can use Module.TypeSystem. Jb On Thu, Feb 23, 2017 at 3:08 PM, Bert Proesmans <[email protected]> wrote: > Hey, > > I use this framework to dynamically update code of existing dll files. > When i inspect the generated file, it has more dependencies than the > original file eg: the mscorlib of the targeted '.Net framework' of the > project doing the patching. > I looked into the source code to prevent Cecil from generating this > dependency, but i can't get my head around it. > > Is there a way to prevent Cecil from adding unnecessary (are they > eventually unnecessary?) dependencies when generating updated dll files? > > Intuitively i think updating the target '.Net framework' of the project > doing the patching will also work, but that would mean i have to re-target > for every different > dll version i want to patch. > > Maybe i'm missing something? > > I'm looking forward to your help and thanks in advance, > Bert. > > -- > -- > -- > 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.
