diff --git a/src/coreclr/vm/clsload.cpp b/src/coreclr/vm/clsload.cpp index 0c42ca20161eee..02eecdcafd0b30 100644 --- a/src/coreclr/vm/clsload.cpp +++ b/src/coreclr/vm/clsload.cpp @@ -3482,6 +3482,12 @@ VOID ClassLoader::AddAvailableClassHaveLock( if (SUCCEEDED(pMDImport->GetNestedClassProps(classdef, &enclosing))) { // nested type + if (enclosing == COR_GLOBAL_PARENT_TOKEN) + { + // Types nested in the class can't be found by lookup. + return; + } + COUNT_T classEntryIndex = RidFromToken(enclosing) - 1; _ASSERTE(RidFromToken(enclosing) < RidFromToken(classdef)); if (classEntries->GetCount() > classEntryIndex)