title: Value cannot be null. Parameter name: context when trying to resolve a class
body: <p>I've been using Autofac for a while and it has worked flawlessly.</p>
  
  <p>When I recently wanted to implement it in another project, I immediately encountered an exception that I have no idea why it occurs or where it could stem from.</p>
  
  <blockquote>
    <p>System.ArgumentNullException: "Value cannot be null. Parameter name:
    context"</p>
  </blockquote>
  
  <pre><code>Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
  Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable`1 parameters)
  Autofac.ResolutionExtensions.Resolve(IComponentContext context)
  AssetManagement.App.Test.Main(String[] args) in Test.cs: line: 24
  System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
  System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  System.Threading.ThreadHelper.ThreadStart()
  </code></pre>
  
  <p><strong>App.cs</strong>:</p>
  
  <pre><code>public class Test
  {
          public static void Main(string[] args)
          {
              var scheduledJob = Startup.Container.Resolve&lt;IScheduledJob&gt;();   // Exception on this line
          }
  }
  </code></pre>
  
  <p><strong>Startup.cs</strong>:</p>
  
  <pre><code>internal static class Startup
  {
          public static IContainer Container { get; private set; }
  
  
          public static void Run()
          {
              var builder = new ContainerBuilder();
  
  
              builder.RegisterType&lt;Test.ScheduledJobTest&gt;().As&lt;IScheduledJob&gt;();
  
  
              Container = builder.Build();
          }
      }
  </code></pre>
  
  <p>The strange thing is that I'm getting this exception regardless if I've registered any components in <code>Startup</code> or not.</p>
  
  <p>Another peculiar thing is that I'm getting the error regardless of which class I'm trying to resolve.</p>
  
  <p>Same error is given to me with the following code:</p>
  
  <pre><code>var scheduledJob = Startup.Container.Resolve&lt;Exception&gt;();
  </code></pre>