I have written a simple interface and placed it in its own assembly. It defines one method (see attached). In another assembly, I have added a reference to the interface assembly, and I have a using statement at the top of the class. I specify the class is supposed to implment the interface.
And indeed, if I do not implement the method, I get a compilier error about the missing method. But I also get the following compilier error:
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.
I have tripled checked that I am referencing the assembly that defines the interface. And for kicks, I added another class to the interface assembly, and I make an instance of that class in my class that is implementing the interface. I dont get any problems with this, so I know that it is finding the reference to that assembly.
The only other clue if that I got the above error message twice when I first started, and the only way I could get rid of one of the messages was to add a reference to the interface into the assembly of the main application (a third assembly).
I tried defining the interface in its own class file in the same assembly as the implementor, and this worked fine. So there must be some trick to declaring an interface in one assembly, and referencing that interface from another assembly.
I also tried using explicit naming for the interface. That is, I used the fully qualified package, class and method name where I defined my implemented method, but I still got the same error.
All of this seems totally broken. I simply want to build an interface and implement it. But with this error, I am unable to do anything.
Can someone suggest how I can resolve this problem or at least understand what is wrong? Where could the problem be?
thanks
Bryan
Here is the top of the class that is implementing the interface:
using COSPInterfaces;
namespace COSPDialogs
{
public class BaseDialog : System.Windows.Forms.Form, COSPInterfaces.EnableNotify, ICloneable
public void setEnable( bool value )
{
this.m_isEnabled = value;
this.Invalidate( );
}
}
And indeed, if I do not implement the method, I get a compilier error about the missing method. But I also get the following compilier error:
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.
I have tripled checked that I am referencing the assembly that defines the interface. And for kicks, I added another class to the interface assembly, and I make an instance of that class in my class that is implementing the interface. I dont get any problems with this, so I know that it is finding the reference to that assembly.
The only other clue if that I got the above error message twice when I first started, and the only way I could get rid of one of the messages was to add a reference to the interface into the assembly of the main application (a third assembly).
I tried defining the interface in its own class file in the same assembly as the implementor, and this worked fine. So there must be some trick to declaring an interface in one assembly, and referencing that interface from another assembly.
I also tried using explicit naming for the interface. That is, I used the fully qualified package, class and method name where I defined my implemented method, but I still got the same error.
All of this seems totally broken. I simply want to build an interface and implement it. But with this error, I am unable to do anything.
Can someone suggest how I can resolve this problem or at least understand what is wrong? Where could the problem be?
thanks
Bryan
Here is the top of the class that is implementing the interface:
using COSPInterfaces;
namespace COSPDialogs
{
public class BaseDialog : System.Windows.Forms.Form, COSPInterfaces.EnableNotify, ICloneable
public void setEnable( bool value )
{
this.m_isEnabled = value;
this.Invalidate( );
}
}