I have this class :
public class Repo
{
public Repo() : this(ConfigurationManager.AppSettings["identity"], ConfigurationManager.AppSettings["password"])
{
}
public Repo(string identity,string password)
{
//Initialize properties.
}
}
I added a line to web.config so that this type will be automatically constructed by Unity container.
but during the execution of my application, I receive this error message :
"System.InvalidOperationException : the parameter identity could not be resolved when attempting to call constructor Repo(String identity, String password) -->Microsoft.Practices.ObjectBuilder2.BuildFailedException : The current Build operation ...."
1) Why isn't Unity using the default constructor ?
2) Suppose I want Unity to use the second constructor (the parametized one), How do I pass that information to Unity via the configuration file ?