Hey Florian (yeah nice to see you :P),
I managed to reproduce your issue with the following code:
var res = new DefaultAssemblyResolver();
AssemblyDefinition asm = res.Resolve("System.ServiceModel, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089");
var mdtoken = asm.MainModule.LookupToken(167776355);
I'm getting the same NotSupportedException with the same stack trace as you
wrote.
I tried getting the same field through the normal API, using the following
code:
var type =
asm.MainModule.GetType("System.ServiceModel.Channels.ReliableChannelBinder`1/CloseAsyncResult");
var field = type.GetField("onBinderCloseComplete");
It runs without any problems. However, it's MetadataToken property gives
back the following object:
{[Field:0x1d2d]}
RID: 7469
token: 67116333
TokenType: Field
LookupToken(67116333) then returns the field, as expected.
So it appears that either you're looking up the wrong token, or,
GetMemberReferences() is buggy.
I'm afraid that's all I can help you with in this case.
Cheers!
((TLL)ShdNx :))
2011/5/21 Florian <[email protected]>
> Anyone who can reproduce this exception? Anyone any idea?
>
> Thanks
>
> --
> --
> mono-cecil
--
--
mono-cecil