문제를 디버깅하는 동안 mscorlib을 조사 중이며 GetName()
(System.Reflection.Assembly
)입니다.Decompiled 때 System.Reflection.Assembly의 GetName이 NotImplementedException을 throw하는 것으로 나타나는 이유는 무엇입니까?
dotPeek의 메서드에 대한 코드를 보면 또한 reference source에 GetName()
의 코드가 그 안에 아무것도 없어 보인다 및 던져 NotImplementedException
:
#if FEATURE_CORECLR
[System.Security.SecurityCritical] // auto-generated
#endif
public virtual AssemblyName GetName()
{
return GetName(false);
}
#if FEATURE_CORECLR
[System.Security.SecurityCritical] // auto-generated
#endif
public virtual AssemblyName GetName(bool copiedName)
{
throw new NotImplementedException();
}
이 예외를 던질 것으로 보인다 왜 사람이 설명 할 수, typeof(object).GetTypeInfo().Assembly.GetName().Version.ToString()
과 같은 코드 줄을 사용하면 올바른 버전의 DLL을 반환합니까? Assembly
기본 클래스이기 때문이다
"Assembly"에서 파생 된 * 유형이 있습니다. 특히 ['RuntimeAssembly'] (http://referencesource.microsoft.com/#mscorlib/system/reflection/assembly.cs,73b5be5e9c2474b2,references). –