Hi Kosta,

On Fri, Jan 7, 2011 at 8:09 PM, zertsekel <[email protected]> wrote:
> Please consider the below code I see in some project:
>    TypeReference tr0 = new TypeReference(...);
>    TypeReference tr1 = assembly.MainModule.Import(rt0);
> In the VC2008 debugger I see no difference between tr0 and tr1.
> Is this a correct usage of ModuleDefinition::Import()?

No it's not. You need to Import a reference only if the reference
comes from a different module. If you create the reference yourself,
you just pass the appropriate module, and thus, you don't need to
import it:

You can read:

https://github.com/jbevain/cecil/wiki/Importing

Jb

-- 
--
mono-cecil

Reply via email to