really easy question about interfaces and assemblies
Posted on 2003-02-23
I am trying to do such a basic thing. I have written an interface and I have a class that implements the interface. The interface is defined in COSPPanels assembly, and the class that is implementing the interface is defined in the assembly COSPDialogs.
Here is my interface:
public interface EnableNotify
void setEnable( bool value );
And here is the main line in my implementing class:
public class BaseDialog : System.Windows.Forms.Form,
And I have a reference to COSPPanels in my COSPDialogs assembly. But I always get the following error when I build my COSPDialogs assembly:
C:\cosp_ui_solution\cosp_ui\WindowsApplication1\bin\Debug\COSPDialogs.dll Referenced class 'COSPDialogs.BaseDialog' has base class or interface 'COSPInterfaces.EnableNotify' defined in an assembly that is not referenced. You must add a reference to assembly 'COSPInterfaces'.
But I have a reference to the assembly with the interface defined!
What can be wrong? What else can I do to write and use an interface?
If I add a dummy class to the assembly with the interface, and I make an instance of that class, it works fine. The problem only shows up when I implement the interface. I noticed I get the error message twice. If I add a reference to the main application project, one of the two errors goes away. But the main application has no knowledge of the interface. If I dont implement the method the interface declares, then I get an error about the missing implementation, and about the reference not found. So it seems to be reading the interface correctly and the system expects to see my class implementing the interface expected.