title: NancyFx passing an Interface to a module constructor results in error
body: <p>When I pass an interface into my module constructor it results in the error: <code>Unable to resolve type: System.Web.HttpContextBase</code>. Below is the Module code:</p>
  
  <pre><code>public class LeaderboardModule : NancyModule
  {
      private readonly IUserService _userService;
  
      public LeaderboardModule(IUserService userService)
      {
          _userService = userService;
  
          Get["/"] = _ =&gt; View["Index"];
  
          Get["/NewUser"] = _ =&gt; View["NewUser.cshtml"];
  
          Post["/NewUser"] = _ =&gt; View["NewUser.cshtml"];
  
          Get["/UserList"] = _ =&gt;
          {
              var userList = _userService.GetUsers();
  
              return View["UserList.cshtml", userList];
          };
      }
  }
  </code></pre>
  
  <p>And here is the stack trace:</p>
  
  <pre><code>[TinyIoCResolutionException: Unable to resolve type: System.Web.HttpContextBase]
      Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration,     NamedParameterOverloads parameters, ResolveOptions options) +1940
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType,     ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type: Metro.Leaderboard.Data.JsonService]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType,   ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container,   NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType,     ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type: Metro.Leaderboard.Business.UserService]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container,    NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.SingletonFactory.GetFactoryForChildContainer(Type type, TinyIoCContainer parent,   TinyIoCContainer child) +100
     Nancy.TinyIoc.TinyIoCContainer.GetParentObjectFactory(TypeRegistration registration) +141
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration,   NamedParameterOverloads parameters, ResolveOptions options) +712
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type:     Metro.Leaderboard.Web.Modules.LeaderboardModule]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.&lt;ResolveAllInternal&gt;b__43(TypeRegistration registration) +91
     System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
     System.Linq.&lt;CastIterator&gt;d__b1`1.MoveNext() +85
     Nancy.Routing.RouteCache.BuildCache(IEnumerable`1 modules) +514
     Nancy.Routing.RouteCache..ctor(INancyModuleCatalog moduleCatalog, INancyContextFactory   contextFactory, IRouteSegmentExtractor routeSegmentExtractor, IRouteDescriptionProvider   routeDescriptionProvider, ICultureService cultureService) +189
     lambda_method(Closure , Object[] ) +221
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType,  ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +1100
  
      [TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.RouteCache]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +1178
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRouteResolver]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRequestDispatcher]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +774
  
  [TinyIoCResolutionException: Unable to resolve type: Nancy.NancyEngine]
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +965
     Nancy.TinyIoc.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +99
     Nancy.TinyIoc.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +213
     Nancy.TinyIoc.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +225
     Nancy.TinyIoc.TinyIoCContainer.Resolve(Type resolveType) +106
     Nancy.TinyIoc.TinyIoCContainer.Resolve() +112
     Nancy.DefaultNancyBootstrapper.GetEngineInternal() +56
     Nancy.Bootstrapper.NancyBootstrapperBase`1.SafeGetNancyEngineInstance() +61
  
  [InvalidOperationException: Something went wrong when trying to satisfy one of the dependencies  during composition, make sure that you've registered all new dependencies in the container and      inspect the innerexception for more details.]
     Nancy.Bootstrapper.NancyBootstrapperBase`1.SafeGetNancyEngineInstance() +135
     Nancy.Bootstrapper.NancyBootstrapperBase`1.GetEngine() +113
     Nancy.Hosting.Aspnet.NancyHttpRequestHandler..cctor() +65
  
  [TypeInitializationException: The type initializer for 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler' threw an exception.]
     Nancy.Hosting.Aspnet.NancyHttpRequestHandler..ctor() +0
  
  [TargetInvocationException: Exception has been thrown by the target of an invocation.]
     System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
     System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +113
      System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +232
      System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
      System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark&amp; stackMark) +1136
      System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
      System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +18
      System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
      System.Web.Configuration.HandlerFactoryCache..ctor(String type) +46
      System.Web.HttpApplication.GetFactory(String type) +86
      System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +262
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  </code></pre>
  
  <p>My initial thought is that it's an issue with the Nancy bootstrapper, so I decided to use <code>StructureMap</code> and I'm still getting the same error! Any help on this would be greatly appreciated</p>