Compiler Error CS0424
'class': a class with the ComImport attribute cannot specify a base class
Specifying the ComImportAttribute attribute implies that the implementation for the class is to be imported from a COM module. Additional methods or fields inherited from the base class are not allowed to be added to the implementation defined in the COM module.
The following sample generates CS0424:
// CS0424.cs
// compile with: /target:library
using System.Runtime.InteropServices;
public class A {}
[ ComImport, Guid("7ab770c7-0e23-4d7a-8aa2-19bfad479829") ]
class B : A {} // CS0424 error
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: