Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DelegateSerializationHolder is not permitted to be deserialized at this security level

DelegateSerializationHolder is not permitted to be deserialized at this security level

Scheduled Pinned Locked Moved C#
sysadminsecurityhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nigel Mackay
    wrote on last edited by
    #1

    I'm not sure how much code you need to see to handle this problem. I am trying to add the ability for any logged-on client to send a message to all other logged-on clients. My server code looks like this:

    public OedipusServer
    {
    // Register our tcp channel
    bool ensureSecurity = true;
    RemotingConfiguration.Configure("oedipus.exe.config", ensureSecurity);

    UserList insUserList = UserList.Instance;
    ObjRef refUserList = RemotingServices.Marshal(insUserList, "UserList");
    ... // More classes instanced here
    ServerClass insServerClass = ServerClass.Instance;
    ObjRef refAServerClass = RemotingServices.Marshal(insServerClass, "Messaging");
    }
    public class ServerClass : AbstractServer
    {
    private static ServerClass mInstance = null;
    public static ServerClass Instance
    {
    get
    {
    if (mInstance == null)
    mInstance = new ServerClass();
    return mInstance;
    }
    }
    public override Object InitializeLifetimeService()
    {
    return null;
    }
    public override void myStatusHasChanged(int userID, int newStatus)
    {
    FireNewBroadcastedMessageEvent(userID, newStatus);
    }
    public event StatusChangedEventHandler myStatusChangedHandler;
    public override event StatusChangedEventHandler myStatusChangedEvent
    {
    add
    {
    myStatusChangedHandler = value;
    }
    remove
    {
    }
    }
    protected void FireNewBroadcastedMessageEvent(int userID, int newStatus)
    {
    myStatusChangedHandler(userID, newStatus);
    }
    }

    I have another project, Messaging, which looks like this:

    public delegate void StatusChangedEventHandler(int userID, int newStatus);
    public abstract class AbstractServer : MarshalByRefObject
    {
    public abstract void myStatusHasChanged(int userID, int newStatus);
    public abstract event StatusChangedEventHandler myStatusChangedEvent;
    }
    public abstract class AbstractBroadcastedMessageEventSink : MarshalByRefObject
    {
    public void callbackStatusChanged(int userID, int newStatus)
    {
    internalCallbackStatusChanged(userID, newStatus);
    }
    protected abstract void internalCallbackStatusChanged(int userID, int newStatus);
    }

    On the client side I have:

    class EventSink : AbstractBroadcastedMessageEventSink
    {
    protected override void internalCallbackStatusChanged(int userID, int newStatus)
    {
    // Handle event here
    }
    }
    private AbstractServer rmMessaging;
    public Office()
    {
    rmMessaging = (Abstr

    L 1 Reply Last reply
    0
    • N Nigel Mackay

      I'm not sure how much code you need to see to handle this problem. I am trying to add the ability for any logged-on client to send a message to all other logged-on clients. My server code looks like this:

      public OedipusServer
      {
      // Register our tcp channel
      bool ensureSecurity = true;
      RemotingConfiguration.Configure("oedipus.exe.config", ensureSecurity);

      UserList insUserList = UserList.Instance;
      ObjRef refUserList = RemotingServices.Marshal(insUserList, "UserList");
      ... // More classes instanced here
      ServerClass insServerClass = ServerClass.Instance;
      ObjRef refAServerClass = RemotingServices.Marshal(insServerClass, "Messaging");
      }
      public class ServerClass : AbstractServer
      {
      private static ServerClass mInstance = null;
      public static ServerClass Instance
      {
      get
      {
      if (mInstance == null)
      mInstance = new ServerClass();
      return mInstance;
      }
      }
      public override Object InitializeLifetimeService()
      {
      return null;
      }
      public override void myStatusHasChanged(int userID, int newStatus)
      {
      FireNewBroadcastedMessageEvent(userID, newStatus);
      }
      public event StatusChangedEventHandler myStatusChangedHandler;
      public override event StatusChangedEventHandler myStatusChangedEvent
      {
      add
      {
      myStatusChangedHandler = value;
      }
      remove
      {
      }
      }
      protected void FireNewBroadcastedMessageEvent(int userID, int newStatus)
      {
      myStatusChangedHandler(userID, newStatus);
      }
      }

      I have another project, Messaging, which looks like this:

      public delegate void StatusChangedEventHandler(int userID, int newStatus);
      public abstract class AbstractServer : MarshalByRefObject
      {
      public abstract void myStatusHasChanged(int userID, int newStatus);
      public abstract event StatusChangedEventHandler myStatusChangedEvent;
      }
      public abstract class AbstractBroadcastedMessageEventSink : MarshalByRefObject
      {
      public void callbackStatusChanged(int userID, int newStatus)
      {
      internalCallbackStatusChanged(userID, newStatus);
      }
      protected abstract void internalCallbackStatusChanged(int userID, int newStatus);
      }

      On the client side I have:

      class EventSink : AbstractBroadcastedMessageEventSink
      {
      protected override void internalCallbackStatusChanged(int userID, int newStatus)
      {
      // Handle event here
      }
      }
      private AbstractServer rmMessaging;
      public Office()
      {
      rmMessaging = (Abstr

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It seems your remoting configuration is not correct.This stuff might help you to solve your the problem.

      N 1 Reply Last reply
      0
      • L Lost User

        It seems your remoting configuration is not correct.This stuff might help you to solve your the problem.

        N Offline
        N Offline
        Nigel Mackay
        wrote on last edited by
        #3

        Thanks. I found another article which discussed the problem and offered the solution of using a wrapper class. It still didn't work until I realised that I couldn't use tcp. Adding a separate channel using http/Soap/Singleton (as your article states) solved the problem. So I have a tcp channel for my data-access and an http channel for braodcasting messages.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups