0

Scenario is that,

ClassA in current Project

ClassB in AssemblyB

ClassC in AssemblyC

Class Heirarchy

ClassA:ClassB
{
}

ClassB:ClassC
{
}

And the analyzer Code,

var declaredSymbol = _semanticModel.GetDeclaredSymbol( type);
var baseType = declaredSymbol.BaseType;

while (baseType != null && baseType.Name != "Object")
{
  inheritanceCount++;
  baseType = baseType.BaseType;
}

When type is ClassA, it can detect ClassB as basetype and after that the chain breaks, for ClassB it can't find BaseType (which should be ClassC, residing in Assembly C)

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
Sarker
  • 922
  • 7
  • 16

0 Answers0