title: C# Reflection reference to another class from inside a DLL
body: <p>I have 2 classes, one is a DLL and the other is a .cs File and i want to call a Method in the .cs File from the DLL.</p>
  <p>DLL</p>
  <pre><code>namespace SimpleDebugFormatting
  {
      public static class DebugLog
      {
          private static Type debugFormat;
          private static Type DebugFormat
          {
              get
              {
                  if (debugFormat == null)
                      return debugFormat = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(_Type =&gt; _Type.Name.Contains(&quot;DebugFormat&quot;));
  
                  return debugFormat;
              }
          }
  
          public static List&lt;string&gt; GetMessages(IEnumerable _Parameters)
          {
              return (List&lt;string&gt;)DebugFormat.GetMethod(&quot;ConcatMessages&quot;, BindingFlags.Static | BindingFlags.NonPublic).Invoke(DebugFormat, new object[] { _Parameters });
          }
      }
  }
  </code></pre>
  <p>.cs File</p>
  <pre><code>namespace SimpleDebugFormatting
  {
      internal static class DebugFormat
      {
          internal static List&lt;string&gt; ConcatMessages(object[] _Messages) { }
      }
  }
  </code></pre>
  <p>When both classes are .cs files it all works fine, but when the &quot;DebugLog&quot;-class is a DLL it can't find the &quot;DebugFormat&quot;-class.</p>
  <p>When i try to print all types in the DLL's assembly with
  <br/>
  &quot;<em>Assembly.GetExecutingAssembly().GetTypes()</em>&quot;,
  <br/>
  it only shows these 2:</p>
  <pre><code>SimpleDebugFormatting.DebugLog
  SimpleDebugFormatting.DebugLog+&lt;&gt;c
  </code></pre>
  <p>Why is that so and how can i get it to work?</p>