今天在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
   {
   }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2021-10-18
  • 2021-11-02
  • 2021-12-05
猜你喜欢
  • 2021-08-20
  • 2021-07-23
  • 2021-11-28
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案