title: C# Remoting (legacy) from nunit tests causes Security exception
body: <p>I am writing system wide tests for legacy api that uses remoting. Remoting is working if i call it from example: console application.</p>
  
  <p>However following code from NUnit project:</p>
  
  <pre><code>((FooBar)System.Activator.GetObject(typeof (FooBar), "http://localhost/FooBar.rem")).SomeMethod("abc");
  </code></pre>
  
  <p>Fails with exception:</p>
  
  <pre><code>System.Security.SecurityException : Type System.Runtime.Remoting.ObjRef and the types derived from it (such as System.Runtime.Remoting.ObjRef) are not permitted to be deserialized at this security level.
  </code></pre>
  
  <p>Many pointers for this exception shows changes on server side security settings, however because server works with other consumer it seems that security issue is on client side.</p>
  
  <p>I have tried add:</p>
  
  <pre><code>        var clientProvider = new BinaryClientFormatterSinkProvider();
          IDictionary props = new Hashtable();
  
          const int httpConnectionLimit = 100;
          const int httpTimeout = 30*1000;
  
          props["clientConnectionLimit"] = httpConnectionLimit;
          props["timeout"] = httpTimeout;
  
          var channel = new HttpChannel(props, clientProvider, null);
          ChannelServices.RegisterChannel(channel, false);
  </code></pre>
  
  <p>No effect.</p>
  
  <p>Runner is Resharper 9. Tried MS runner too but seems to fail with same error.</p>
  
  <p>Sadly, at this point of refactoring old system to use modern technologies like rest to communication isn't an option.</p>
  
  <p>Tested with Nunit 2.6.3 and 2.6.4. 2.6.2 had one issue which looked like this but it seems this isn't same.</p>