Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetFindTypeRef and EnumTypeRefs

  • Donnerstag, 2. Juli 2009 18:20krt_4tfy TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     

    I am seeing different results from FindTypeRef and EnumTypeRefs.  If for example I look for System.Object in a specific module I can always find it via EnumTypeRefs, but sometimes FindTypeRef fails while acessing through the same IMetaDataImport interface.  Is this a bug or known restriction or am I doing something wrong?

     

    Thanks

Antworten

  • Donnerstag, 2. Juli 2009 20:13Karel ZikmundMSFT, ModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    Check the resolution scope you are passing to FindTypeRef. Is it AssembyRef of mscorlib.dll? Try to log it form your app and compare it with output from "ildasm /met Your.dll /out=Your.il". Also check that there are not nasty surprises like 2 references to different versions of mscorlib.dll in the image you are openenig.

    -Karel

Alle Antworten

  • Donnerstag, 2. Juli 2009 20:13Karel ZikmundMSFT, ModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    Check the resolution scope you are passing to FindTypeRef. Is it AssembyRef of mscorlib.dll? Try to log it form your app and compare it with output from "ildasm /met Your.dll /out=Your.il". Also check that there are not nasty surprises like 2 references to different versions of mscorlib.dll in the image you are openenig.

    -Karel