On 02.08.2011 14:22, [email protected] wrote: > We are wondering if there is any way to get an unique identifying > string for a method using cecil. We tried the FullName property, but > unfortunately it's not working properly with generic methods (for > example number of generic parameters is missing, etc.) I can offer an implementation of "ID strings" (C# specification, appendix A.3.2): https://github.com/icsharpcode/ILSpy/blob/master/ILSpy/XmlDoc/XmlDocKeyProvider.cs
> We try to detect all overrides and so far we found no cecil
> implementation for this
Be careful when using method signature IDs to detect overrides.
Consider this example:
class Base<T> {
public virtual void M(List<T> p) {}
}
class Derived<T,S> : Base<S[]> {
public override void M(List<S[]> p) {}
}
If you compare the signatures of the two method definitions, they won't
match.
You would have to construct the instantiated method "Base<S[]>.M"
(perform type substitution in all method parameters) in order to get the
same method signature.
Daniel
signature.asc
Description: OpenPGP digital signature
