I guess the problem is that I'm actually "abusing" the import mechanism here. I'm not using it to write an assembly in the end, I'm only using it to bridge System.Reflection Members to Cecil in Unit tests. I'll try importing the declaring type and using that as a context too.
On Wed, Sep 15, 2010 at 11:01 AM, Jb Evain <[email protected]> wrote: > On Wed, Sep 15, 2010 at 10:46 AM, Johannes Rudolph > <[email protected]> wrote: > > When I can read the open generic type reference from the assembly just > fine, > > I should be able to import it the same way. Or did I get something else > > wrong here? > > It's a currently a false assumption. You need a context for generic > instances that are not closed. You can't just import an open generic > instance without providing it a proper context inside your new module. > In your case, as you want to work on the open type, you just have to > import the declaring type of the field first, and use it as a context. > > -- > Jb Evain <[email protected]> > > -- > -- > mono-cecil > -- -- mono-cecil
