title: Get the entire assembly in C#
body: <p>I'm trying to eliminate a call from my API in which the end-user has to pass <code>Assembly.GetExecutingAssembly()</code> in their code, currently my code looks lke the following.</p>
  
  <pre><code>public static Dictionary&lt;int, Packet&gt; Packets { get; private set; }
  
  public static void Init()
  {
      Assembly assembly = Assembly.GetExecutingAssembly();
  
      foreach (Type type in assembly.GetTypes())
      {
          if (type.BaseType == typeof(Packet))
          {
               ...
          }
      }
  }
  </code></pre>
  
  <p>However this only gets all of the classes that are available in the API.dll, and none of the classes from the project that's using the .dll are included,</p>
  
  <p>However if I pass it as a paramter, like so:</p>
  
  <pre><code> public static void Init(Assembly assembly) {}
  </code></pre>
  
  <p>it loads everything just fine, is this intended behaviour, is there a way to do this all in the background without the end-user ever having to worry about the Assmebly call? </p>
  
  <p><strong>In a nutshell</strong> - I have a .dll file that people will be using in their projects, I want to get all of the classes from the project that's using the .dll, not all of the classes inside of the .dll</p>