jeudi 21 décembre 2017

Why does GetName in System.Reflection.Assembly appear to throw a NotImplementedException when decompiled?

While debugging an issue I was digging in to mscorlib and specifically at GetName() in System.Reflection.Assembly.

Looking at the code for the method in dotPeek and also on reference source the code for GetName() seems to have nothing in it and throws a not implemented exception (see image).

enter image description here

Can anyone explain why this appears to throw an exception, but using a line of code such as typeof(object).GetTypeInfo().Assembly.GetName().Version.ToString() returns the correct version of the DLL?





Aucun commentaire:

Enregistrer un commentaire