This project is read-only.

error - Dynamic operations can only be performed in homogenous AppDomain.

Feb 28, 2013 at 10:10 PM
Hello All -

Trying to use this project and am receiving an error I'm not familiar with:

InvalidOperationException (Client.cs:Emit:295)

Message=Dynamic operations can only be performed in homogenous AppDomain.


at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at SocketIOClient.Client.Emit(String eventName, Object payload) in C:\Development

Socket appears to be connecting to my Node.Js Socket.IO correctly but when I call emit I receive this.

Any ideas ?

Tx
Coordinator
Feb 28, 2013 at 10:32 PM
Are you using this from a client app or from asp.net WebForm / MVC project - any other pertinent details you can give as to your setup?
Mar 1, 2013 at 12:08 AM
Using it via c# in a .net 4 winform application.
Coordinator
Mar 1, 2013 at 12:37 AM
So what alterations to the source code have you made and/or is this from the master branch or what?
The key point is client.cs line 295 doesn't match master/client.cs by line number, and the signature for the Emit method payload param being Object, not dynamic.
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at SocketIOClient.Client.Emit(String eventName, Object payload) in C:\Development

Source Code snippet

public void Emit(string eventName, dynamic payload_)
        {
            this.Emit(eventName, payload, string.Empty, null);
        }
Mar 1, 2013 at 1:23 AM
Haven't knowingly changed anything - originally was working from the Nuget package and received this error so I grabbed the source and added the SocketIOClient project to my solution.

IF I step into the code I see the code you indicated above - the actual exception is on this line -this.Emit(eventName, payload, string.Empty, null);
Mar 1, 2013 at 2:05 AM
I created a small test app and all runs fine. After a lot of searching it appears to be caused by AppDomain.CurrentDomain.IsHomogenous being equal to false. In my test app it is true.

The real application is quite large so now on to figuring out why IsHomogenous is false.

Tx for the quick responses.