11

Given PEVerify error and warning output such as that below, how does one track back to the offending class and interface names? Assume I am not a compiler author or IL magician.

[MD]: Error: Class implements interface but not method (class:0x02000091; interface:0x06000169;method:0x00000000). [token:0x09000043]
[MD]: Warning: MemberRef has a duplicate, token=0x0a0001ff. [token:0x0A000060]
bentayloruk
  • 4,060
  • 29
  • 31
  • If you're not a compiler author or IL hacker, how did you produce an assembly with these problems? .NET compilers produce valid assemblies in all cases (short of compiler bugs ofc) – thecoop Jul 05 '11 at 16:21
  • @thecoop Since originally posting the question, I've determined that these errors are in a third-party assembly. The assembly is an OSS project build, so would still like to track it down. – bentayloruk Jul 05 '11 at 16:25
  • 1
    @thecoop it would appear that these errors occur when you implement the [IHideObjectMember intellisense trick](http://blogs.clariusconsulting.net/kzu/how-to-hide-system-object-members-from-your-interfaces/). It is the cause in our case and we have verified it on a second assembly that uses this trick (Autofac and Moq). – bentayloruk Jul 12 '11 at 12:59
  • Apparently MS are aware of this issue and it would *appear* to be a bug in PEVerify. – bentayloruk Jul 12 '11 at 13:21

1 Answers1

14

Use ILDASM and load the assembly in question. Go to View->MetaInfo->Show! This opens up a text viewer showing a human readable version of the assembly metadata. Search for the hex identifiers (but skip the "0x" portion) to find the relevant class, interface and methods.

Josh Gallagher
  • 5,211
  • 2
  • 33
  • 60
  • Is there any way to do this programatically? – BatteryBackupUnit May 02 '14 at 11:04
  • 1
    The PE file format, the header of which contains this information, is well documented and has structs defined in the windows header files in the Windows SDK, most of which are available as C# structs for PInvoke mappings. Here's someone's code for reading a different part of that header out: http://code.cheesydesign.com/?p=572 – Josh Gallagher May 02 '14 at 14:18