title: Resolving a service in autofac without registering service type
body: <p>Is it possible to resolve a service in autofac without registering it with the container? </p>
  
  <p>So far I have come up with something like this:</p>
  
  <pre><code>    public object ResolveUnknownService(IContainer container, Type serviceType)
      {
          ILifetimeScope lifetimeScope = container.BeginLifetimeScope(b =&gt; b.RegisterType(serviceType).ExternallyOwned());
          try
          {
              return lifetimeScope.Resolve(serviceType);
          }
          finally
          {
              lifetimeScope.Dispose();
          }
      }
  </code></pre>
  
  <p>It works, but I am a bit worried about performance. I also don't want to use AnyConcreteTypeNotAlreadyRegisteredSource beacuse I want to be specific about which services I want (or don't want) to resolve this way.</p>