Custom delegate which can return serilizible IAsyncResult objecy RRS feed

  • Question

  • Dear All,

    I am developing hosting application which uses multiple appdomains for hosting the components. Every call between the hosting application and component is Asynchronous call.  .net delegate returns non serializable IAsynResult object in asynchronous call and exception is coming when IAsyncResult is getting pass across the appdomain. I want to make my own delegate which will return serializble IAsyncResult object.

    Can any one tell how to make own delegate class?

    I have seen some sample code here. but it is not good for me because function signature can not be defined like delegate.




    Friday, June 8, 2012 8:51 AM


  • Hi Ravi,

    Welcome to the MSDN Forum.

    What do you mean about  which will return serializble IAsyncResult object.

    In my opinion, an object is serializable or not, it is determined by it implements the iserializable interface or not. And it is similar to IAsyncResult

    So what do you mean about make a delegate class?

    How about this one: http://msdn.microsoft.com/en-us/library/system.delegate.aspx ?

    You can implement the Iserializable and IAsynresult interface in the class mySampleClass. And then, the delegate should return an object you wanted.

    If I have misunderstood anything, please feel free to let me know.

    Best regards,

    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Monday, June 18, 2012 1:47 PM
    Monday, June 11, 2012 8:36 AM