InvalidProgramException: Invalid IL code in System.Runtime.Remoting.Channels.Ipc.IpcClientChannel:get_ChannelName (): IL_0000: ret

This happens when try to do something with remoting.
In a test environment everything works fine. I think I use exactly the same unity-version of remoting assembly there.

I am using Unity 5.5.0b11

The stack trace at error is:

`InvalidProgramException: Invalid IL code in System.Runtime.Remoting.Channels.Ipc.IpcClientChannel:get_ChannelName (): IL_0000: ret

System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel (IChannel chnl, Boolean ensureSecurity) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs:307)
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel (IChannel chnl) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs:276)
System.Runtime.Remoting.Channels.CrossAppDomainChannel.RegisterCrossAppDomainChannel () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs:91)
System.Runtime.Remoting.RemotingServices.RegisterInternalChannels () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:879)
System.Runtime.Remoting.RemotingServices…cctor () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:92)
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for System.Runtime.Remoting.RemotingServices
System.Activator.GetObject (System.Type type, System.String url) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:409)
MmasfCommon.Extension.GetObject[IContext] ()
MmasfPlugin.Context…ctor ()
MmasfPlugin.Context…cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for MmasfPlugin.Context
`

The code to reproduce it is:

using System;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;
using UnityEngine;
using UnityEngine.UI;

public class NewBehaviourScript : MonoBehaviour
{
    void Start()
    {
        var t = GetComponent<Text>();
        //t.text = "Fixed text";
        ChannelServices.RegisterChannel(new IpcChannel());
        var remoteContext = Activator.GetObject(typeof(object), "ipc://test");
        t.text = remoteContext.GetType().FullName;
    }
}

you can copy \Editor\Data\Mono\lib\mono\2.0\System.Runtime.Remoting.dll to Plugins folder, this dll contains full implementation of mono version of Runtime.Remoting