title: No default Instance is registered and cannot be automatically determined for type
body: <p>The definition of my interface is as follows:</p>
  
  <pre><code>public interface IApplicationSettings
  {
     string LoggerName { get; }
     string NumberOfResultsPerPage { get; }
     string EmailAddress { get; }
     string Credential { get; }
  }
  </code></pre>
  
  <p>The implementation of this interface is given below:</p>
  
  <pre><code>public class WebConfigApplicationSettings : IApplicationSettings
      {
          public string LoggerName
          {
              get { return ConfigurationManager.AppSettings["LoggerName"]; }
          }
  
          public string NumberOfResultsPerPage
          {
              get { return ConfigurationManager.AppSettings["NumberOfResultsPerPage"]; }
          }
  
          public string EmailAddress
          {
              get { return ConfigurationManager.AppSettings["EmailAddress"]; }
          }
  
          public string Credential
          {
              get { return ConfigurationManager.AppSettings["Credential"]; }
          }
      }
  </code></pre>
  
  <p>I also created a factory class to obtain the instance of the concrete implementation of WebConfigSettings as follows:</p>
  
  <pre><code>public class ApplicationSettingsFactory
      {
          private static IApplicationSettings _applicationSettings;
  
          public static void InitializeApplicationSettingsFactory(
                                        IApplicationSettings applicationSettings)
          {
              _applicationSettings = applicationSettings;
          }
  
          public static IApplicationSettings GetApplicationSettings()
          {
              return _applicationSettings;
          }
      }
  </code></pre>
  
  <p>Then I resolved dependency as follows:</p>
  
  <pre><code>public class DefaultRegistry : Registry {
  
          public DefaultRegistry() {
              Scan(
                  scan =&gt; {
                      scan.TheCallingAssembly();
                      scan.WithDefaultConventions();
                      scan.With(new ControllerConvention());
                  });
  
  
               For&lt;IApplicationSettings&gt;().Use&lt;WebConfigApplicationSettings&gt;();
  
               ApplicationSettingsFactory.InitializeApplicationSettingsFactory
                                     (ObjectFactory.GetInstance&lt;IApplicationSettings&gt;());
  
          }
      }
  </code></pre>
  
  <p>Now when i running my application it throw me following exception:</p>
  
  <pre><code>Exception has been thrown by the target of an invocation.
  </code></pre>
  
  <p>and the Inner Exception is </p>
  
  <pre><code>No default Instance is registered and cannot be automatically determined for type 'Shoppingcart.Infrastructure.Configuration.IApplicationSettings'\r\n\r\nThere is no configuration specified for Shoppingcart.Infrastructure.Configuration.IApplicationSettings\r\n\r\n1.) Container.GetInstance(Shoppingcart.Infrastructure.Configuration.IApplicationSettings)\r\n
  </code></pre>
  
  <p>I am using StructureMap for MVC5</p>