Merge pull request #2006 from steffen-kiess/posix-sockets-2
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Activation / RemoteActivator.cs
index 67b9efa29255e2467e90f11efd7210fc3d8b035b..9ef311283700716007d22f0ccaddd4402ca1e99b 100644 (file)
@@ -42,7 +42,10 @@ namespace System.Runtime.Remoting.Activation
                        if (!RemotingConfiguration.IsActivationAllowed (msg.ActivationType))
                                throw new RemotingException ("The type " + msg.ActivationTypeName + " is not allowed to be client activated");
 
-                       object[] activationAttributes = new object[] { new RemoteActivationAttribute (msg.ContextProperties) };
+                       object[] activationAttributes = null;
+                       if (msg.ActivationType.IsContextful)
+                               activationAttributes = new object[] { new RemoteActivationAttribute (msg.ContextProperties) };
+
                        MarshalByRefObject newObject = (MarshalByRefObject) Activator.CreateInstance (msg.ActivationType, msg.Args, activationAttributes);
 
                        // The activator must return a ConstructionResponse with an ObjRef as return value.