今天在Silverlight中,新增一个Domain Service,然后名称就叫DomainService,一编译,出错如下。
Error 1 Circular base class dependency involving 'TestQuery.Web.DomainContext' and 'TestQuery.Web.DomainContext' D:\Source_Codes\TEST\TestQuery\TestQuery\Generated_Code\TestQuery.Web.g.cs 86 33 TestQuery
原来是因为The inheritance list for a class includes a direct or indirect reference to itself. A class cannot inherit from itself.
例如这样就会出错:
namespace MyNamespace
{
public interface InterfaceA
{
}
public class MyClass : InterfaceA, MyClass2
{
public void Main()
{
}
}
public class MyClass2 : MyClass // CS0146
{
}
}