I get the following error while:
mConsumerTokenManager = (IConsumerTokenManager)container.Resolve(typeof(IConsumerTokenManager), null);
even though I have
public class InMemoryTokenManager : IConsumerTokenManager, IOpenIdOAuthTokenManager
{
private Dictionary<string, string> tokensAndSecrets = new Dictionary<string, string>();
public InMemoryTokenManager(){}
/// <summary>
/// Initializes a new instance of the <see cref="Ugi.Server.Authentication.Consumers.InMemoryTokenManager"/> class.
/// </summary>
/// <param name="consumerKey">The consumer key.</param>
/// <param name="consumerSecret">The consumer secret.</param>
public InMemoryTokenManager(string consumerKey, string consumerSecret)
{
if (String.IsNullOrEmpty(consumerKey))
{
throw new ArgumentNullException("consumerKey");
}
this.ConsumerKey = consumerKey;
this.ConsumerSecret = consumerSecret;
}
Resolution of the dependency failed, type = "DotNetOpenAuth.OAuth.ChannelElements.IConsumerTokenManager", name =“(none)”.
Exception occurred while: while resolving.
Exception is: InvalidOperationException – The type String cannot be constructed. You must configure the container to supply this value.
———————————————–
At the time of the exception, the container was:Resolving Ugi.Server.Authentication.Consumers.InMemoryTokenManager,(none)(mapped from
DotNetOpenAuth.OAuth.ChannelElements.IConsumerTokenManager, (none))
Resolving parameter “consumerKey” of constructor Ugi.Server.Authentication.Consumers.InMemoryTokenManager(System.String
consumerKey, System.String consumerSecret)
Resolving System.String,(none)
You can use the following code during registration to tell Unity which constructor to use: