This documentation is archived and is not being maintained.

Compiler Error CS0575 

Error Message

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()
      {
      }
   }
}
Show: