- Home /
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;
}
}
Answer by mobiusfr · Aug 29, 2017 at 10:45 AM
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
Your answer
Follow this Question
Related Questions
Oculus virtual reality sdk in build script in Unity 5.4b 2 Answers
How to convert everything from beta version to non-beta version of unity. 0 Answers
Anyone on Unity 5 beta 12 getting this crash? 0 Answers
5.2b6 Store Universal 10 output cannot be built using VS2015 1 Answer
Unity 5.6.0f1 Does not support Nougat 7+ ? Google Console lists Nougat 7+ as unsupported on my apks. 0 Answers