Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error CS0552

'conversion routine' : user defined conversion to/from interface

You cannot create a user-defined conversion to or from an interface. If you need the conversion routine, resolve this error by making the interface a class or derive a class from the interface.

The following sample generates CS0552:

// CS0552.cs
public interface ii

public class a
   // delete the routine to resolve CS0552
   public static implicit operator ii(a aa) // CS0552
      return new ii();

   public static void Main()

Community Additions

© 2014 Microsoft. All rights reserved.