I am having an issue with an explicit interface that I created and am getting the exception,
'x' does not contain a definition for 'y' and no extension method 'y' accepting a first argument of type 'x' could be found
I have a series of classes. The base class:
public interface IFactoryResponse
{
object instance { get; set; }
string instanceconfig { get; set; }
}
The class that explicitly implements it:
public class FactoryResponseImpl : IFactoryResponse
{
object IFactoryResponse.instance {
get { return ((IFactoryResponse)this).instance; }
set { ((IFactoryResponse)this).instance = value; }
}
string IFactoryResponse.instanceconfig {
get { return ((IFactoryResponse)this).instanceconfig; }
set { ((IFactoryResponse)this).instanceconfig = value; }
}
}
and in another class I get the above error. Visual studio can find the interface and class ok, but it can't resolve the instance property. What am I missing here. I am probably missing one of the more refined rules of explicit inheritance.
if (facconfig.useabstract) {
response.instance = Activator.CreateInstance(m_entassembly.GetType(entconfig.Classname, true, true));
response.instanceconfig = facconfig.config;
} else {
Assembly assem = Assembly.LoadFrom(facconfig.assemblyfile);
object Obj = Activator.CreateInstance(assem.GetType(facconfig.Classname, true, true));
response.instance = Obj;
response.instanceconfig = facconfig.config;
}