Compiler Error CS0423
Since 'class' has the ComImport attribute, 'method' must be extern or abstract
Specifying the ComImport attribute implies that the implementation for the class is to be imported from a COM module. Additional methods may not be defined.
The following sample generates CS0423:
C#
// CS0423.cs
using System.Runtime.InteropServices;
[
ComImport,
Guid("7ab770c7-0e23-4d7a-8aa2-19bfad479829")
]
class ImageProperties
{
public static void Main() // CS0423
{
ImageProperties i = new ImageProperties();
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: