20

In C#, trying to compile the following code yields an error, "Circular base class dependency involving 'A' and 'A.B'"

public class A : A.B
{
    public class B { }
}

However, I am looking at a 3rd party DLL via a decompiler, and seeing this structure. How is this possible? I can only assume the third party DLL was written in some other .Net language, but what language and what was the syntax?

Omer Raviv
  • 11,409
  • 5
  • 43
  • 82

2 Answers2

1

It is because the dll you're trying to decompile is "obfuscated". the obfuscator change all the name of the classes so that decompilers cannot be decompiled.

Pyisoe
  • 26
  • 2
0

No DotNet language can do it. Deriving a child class indirectly from itself is wrong and can create circular dependancy. Think from the compiler's perspective, when it tries to compile class A, then first it needs to compile class B which is again dependent on class A and so on. So it creates a forever loop while compiling.

Mayur Dhingra
  • 1,527
  • 10
  • 27
  • 1
    B isn't derived from A, it's nested inside, which has nothing at all to do with the inheritance relationship. – Ben Voigt Dec 07 '13 at 00:44