Hey there. I've sort of run into a problem, and I'm wondering if anyone can help me.
I'm trying to modify an assembly that uses framework version 3.5, but I don't want to be limited to that framework myself. I want to embed some attributes into it, and to do that I need to get references to their types, from the correct assembly version. The attributes are standard .NET attributes and their assemblies live in the GAC. I can't seem to manage to do that. I can't import my own types, because they're from a higher version assembly, and I trying to get the correct assembly by name (using Module.AssemblyResolver.Resolve), doesn't seem to work, even if I specify the exact version I want. It just resolves the wrong assembly. The only thing that seemed to work was using System.Reflection.Assembly.ReflectionOnlyLoad to load the assembly from its AssemblyName (version + name), and using that FullName (which includes the public key) to resolve the assembly using AssemblyResolver. However, this doesn't work properly either, because then the modified assembly gets an indirect dependency on a higher version of mscorlib, somehow. Also, this seems like a really roundabout way to do this. -- -- -- 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.
