title: An unhandled exception of type 'System.IO.FileNotFoundException' - Dll & remoting
body: <p>I'm trying to make a game of Nim where the logic takes place on a server and a client presents the game to get better at .NET Remoting.
  I have a dll I built from this class library:</p>
  
  <pre><code>namespace Nim_Common
  {
      public interface computerCommon
      {
          int[] startGame(int columnNumber);
          int[] computeTurn(int[] penStatus); 
          bool checkWin();
      }
  }
  </code></pre>
  
  <p>That dll I add as a reference to my client project and my server project, and add the dll to the bin/Debug directory in each project.</p>
  
  <p>This is the relevant part of my client code:</p>
  
  <pre><code>using Nim_Common;
  
  namespace Nim
  {
      public partial class Form1 : Form
      {
              private computerCommon computerServerHandler;
              ...
  public Form1()
          {
              InitializeComponent();
              computerToolStripMenuItem.Select();
              newColumnNumber = -1; 
              RemotingConfiguration.Configure("client.exe.config");
              computerServerHandler = (computerCommon)Activator.GetObject(typeof(computerCommon), "http://localhost:1234/_Server_");
              StartGame(this, null);
          }
  private void StartGame(object sender, EventArgs e)
          {
              int max = 0;
              if(columns != null)
                  for (int i = 0; i &lt; columns.Length; i++) Controls.Remove(columns[i]);
              int[] temp = computerServerHandler.startGame(newColumnNumber);
              columns = new Column[temp.Length];
              ...
          }
  </code></pre>
  
  <p>And in the server part:</p>
  
  <pre><code>using Nim_Common;
  
  namespace Nim_Server
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
          private void Form1_Load(object sender, EventArgs e)
          {
              RemotingConfiguration.Configure("server.exe.config");
          }
      }
  
      class ServerPart : MarshalByRefObject, computerCommon
      {
          ...
  
          public ServerPart()
          {
              ...
          }
          public int[] startGame(int columnNumber)
          {
              ...
          }
          public int[] computeTurn(int[] penStatus)
          {
              ...
          }
  
          public bool checkWin()
          {
              ...
          }
      }
  }
  </code></pre>
  
  <p>server.exe.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt; 
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
      &lt;/startup&gt;
    &lt;system.runtime.remoting&gt;
      &lt;application&gt;
        &lt;channels&gt;
          &lt;channel ref="http server" port="1234" /&gt;
        &lt;/channels&gt;
        &lt;service&gt;
          &lt;wellknown mode ="SingleCall" type="Nim_Server.ServerPart, Nim_Server" objectUri="_Server_" /&gt;
        &lt;/service&gt;
      &lt;/application&gt;
    &lt;/system.runtime.remoting&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>client.exe.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt; 
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
      &lt;/startup&gt;
    &lt;system.runtime.remoting&gt;
      &lt;application&gt;
        &lt;channels&gt;
          &lt;channel ref="http client" /&gt;
        &lt;/channels&gt;
  
        &lt;client&gt;
          &lt;wellknown type="Nim_Common.computerCommon, Nim_Common" url="http://localhost:1234" /&gt;
        &lt;/client&gt;
      &lt;/application&gt;
    &lt;/system.runtime.remoting&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My firewall is off if that matters.
  Everything is fine in compile time, the server runs fine. When the client reaches this line, it throws the exception:</p>
  
  <pre><code>int[] temp = computerServerHandler.startGame(newColumnNumber);
  </code></pre>
  
  <p>The exception is something like:</p>
  
  <pre><code>An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
  
  Additional information: Could not load file or one of its dependencies, the system could not find "Nim_Common". // This is shown in my native language so I'm improvising a bit with the translation.
  </code></pre>
  
  <p>What is going on and how do I fix this?</p>
  
  <p>Thanks.</p>