Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0575

Only class types can contain destructors

A struct cannot contain a destructor.

The following sample generates CS0575:

// CS0575.cs
namespace x
{
   public struct iii
   {
      ~iii()   // CS0575
      {
      }

      public static void Main()
      {
      }
   }
}

Community Additions

ADD
Show:
© 2014 Microsoft