In section, 6.4.5 User-defined explicit conversions of the C# Language Specification (version 4.0) it reads:
A user-defined explicit conversion from type S to type T is processed as follows:
• Determine the types S0 and T0. If S or T are nullable types, S0 and T0 are their underlying types, otherwise S0 and T0 are equal to S and T respectively.
• Find the set of types, D, from which user-defined conversion operators will be considered. This set consists of S0 (if S0 is a class or struct), the base classes of S0 (if S0 is a class), T0 (if T0 is a class or struct), and the base classes of T0 (if T0 is a class).
It doesn't define how the compiler will "Find the set of types" but I think it searches all relevant classes looking for candidates for the next step:
• Find the set of applicable user-defined and lifted conversion operators, U. This set consists of the user-defined and lifted implicit or explicit conversion operators declared by the classes or structs in D that convert from a type encompassing or encompassed by S to a type encompassing or encompassed by T. If U is empty, the conversion is undefined and a compile-time error occurs.
This causes it to attempt to resolve the reference to ClassA.