title: C# add a reference using only code (no IDE "Add Reference" functions)
body: <p>I am writting a plugin for a program, and I want to put my code inside a DLL so I can share the plugin freely without exposing (giving away) my code.</p>
  
  <p>Here is the basic structure i have access to :</p>
  
  <pre><code>using System;
  public class Plugin
  {
      public void Initialize()
      {
          //do stuff here
          doWork();
      }
  }
  </code></pre>
  
  <p>Then i just reference the .cs file my code is at and the program "eats" up this Plugin. Now, i have put several logic in there, consisting mostly of functions that arent tied directly to "Initialize()", only on the doWork() function, that starts the whole system.</p>
  
  <p>Now, I want to put all my code inside a DLL, and then just call from inside Initialize(), myDll.doWork() (or something like that).</p>
  
  <p>PS: This dll would ofc be a compiled C# library (could it be called dynamic assembly import? it wouldnt really be dynamic since it would be compiled pre-execution anyways, right?)</p>
  
  <p>PS2: This way I can also add custom resources like forms, images and such without much difficulty right?</p>
  
  <p>PS3: Is there a free tool for protecting the code inside such DLL? (ie protect from beeing easily re engineered) </p>
  
  <p>Thanks in advance =)</p>