Remote Custom Types

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?cmtvemxpbg==?=

    Remote Custom Types

    Is it possible to remotely host custom types?

    Some background...

    We have an application that uses custom user controls as 'templates' for
    entering certain kinds of data. The application is designed to get a list of
    the possible user controls / templates from the database. The user controls
    are all actually derived classes and their base class inherits from
    UserControl. So the app is then able to dynamically load the types based on
    the information it has from the database (assembly path and type) and
    implements them as the base class type. The idea being that we want to be
    able to add templates to the application post-release without having to
    recompile the entire application.

    As we release new templates they are usually in their own assembly. So we
    have had to get them to the application's 'templates' subfolder prior to
    attempting to load their types. We have built this into the application's
    launch.

    The above is functioning just fine. Issues arise though with an evolution
    of the application that is in the works. Parts of the app's UI will need to
    be available for many of our internal apps to use - including the piece that
    allows data entry through these templates. Now, managing the deployment of
    these assemblies for one application has been fine, but this is going to
    become a PITA if we have to deploy them to any other application that needs
    them.

    I'd like to do this without having the UI piece manage the copying of these
    DLLs from some server share.

    So I've been looking into WCF and have been trying to return these templates
    from a method on a WCF Service. I keep getting some errors such as

    "The socket connection was aborted. This could be caused by an error
    processing your message or a receive timeout being exceeded by the remote
    host, or an underlying network resource issue. Local socket timeout was
    '00:00:59.51900 00'."

    I am figuring this has something to do with trying to serialize an object or
    objects that are deriving from UserControl which is not serializable. Am I
    correct? If I attempt to use BinaryFormatter on the collection of templates
    I get an error basically saying just that.

    How can I host these templates and/or their types to the client application?
    I am trying to do this WITHOUT copying DLLs to the client.
  • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

    #2
    RE: Remote Custom Types

    rkozlin,
    There is no "magic" going on here either with classic Remoting or WCF. In
    order for a type to be remoted over the transport, it has to be able to be
    serialized and deserialized. I believe you have answered your own question.

    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "rkozlin" wrote:
    Is it possible to remotely host custom types?
    >
    Some background...
    >
    We have an application that uses custom user controls as 'templates' for
    entering certain kinds of data. The application is designed to get a list of
    the possible user controls / templates from the database. The user controls
    are all actually derived classes and their base class inherits from
    UserControl. So the app is then able to dynamically load the types based on
    the information it has from the database (assembly path and type) and
    implements them as the base class type. The idea being that we want to be
    able to add templates to the application post-release without having to
    recompile the entire application.
    >
    As we release new templates they are usually in their own assembly. So we
    have had to get them to the application's 'templates' subfolder prior to
    attempting to load their types. We have built this into the application's
    launch.
    >
    The above is functioning just fine. Issues arise though with an evolution
    of the application that is in the works. Parts of the app's UI will need to
    be available for many of our internal apps to use - including the piece that
    allows data entry through these templates. Now, managing the deployment of
    these assemblies for one application has been fine, but this is going to
    become a PITA if we have to deploy them to any other application that needs
    them.
    >
    I'd like to do this without having the UI piece manage the copying of these
    DLLs from some server share.
    >
    So I've been looking into WCF and have been trying to return these templates
    from a method on a WCF Service. I keep getting some errors such as
    >
    "The socket connection was aborted. This could be caused by an error
    processing your message or a receive timeout being exceeded by the remote
    host, or an underlying network resource issue. Local socket timeout was
    '00:00:59.51900 00'."
    >
    I am figuring this has something to do with trying to serialize an object or
    objects that are deriving from UserControl which is not serializable. Am I
    correct? If I attempt to use BinaryFormatter on the collection of templates
    I get an error basically saying just that.
    >
    How can I host these templates and/or their types to the client application?
    I am trying to do this WITHOUT copying DLLs to the client.

    Comment

    • Andy

      #3
      Re: Remote Custom Types

      The short answer is you can't. The assemblies must be on both client
      and server.

      Comment

      • sloan

        #4
        Re: Remote Custom Types


        You can distribute an Interface to the client, and not the actual assemblies
        themselves.

        so in assembly1.dll , you'd have
        IEmployee

        and on the server you'd have
        assembly1.dll (also)
        and
        assembly2.dll
        Employee : IEmployee

        and the client doesn't have to have the assembly2.dll or the Employee
        object.

        I'm not sure if this helps or not. I wasn't clear on your post or needs.


        9/27/2005
        Leveraging Dot Net Remoting To Keep Your "Secret Code" Safe


        "rkozlin" <rkozlin@discus sions.microsoft .comwrote in message
        news:6F84A639-6A8B-43DA-B7E5-D74F0CFA00B5@mi crosoft.com...
        Is it possible to remotely host custom types?
        >
        Some background...
        >
        We have an application that uses custom user controls as 'templates' for
        entering certain kinds of data. The application is designed to get a list
        of
        the possible user controls / templates from the database. The user
        controls
        are all actually derived classes and their base class inherits from
        UserControl. So the app is then able to dynamically load the types based
        on
        the information it has from the database (assembly path and type) and
        implements them as the base class type. The idea being that we want to be
        able to add templates to the application post-release without having to
        recompile the entire application.
        >
        As we release new templates they are usually in their own assembly. So we
        have had to get them to the application's 'templates' subfolder prior to
        attempting to load their types. We have built this into the application's
        launch.
        >
        The above is functioning just fine. Issues arise though with an evolution
        of the application that is in the works. Parts of the app's UI will need
        to
        be available for many of our internal apps to use - including the piece
        that
        allows data entry through these templates. Now, managing the deployment
        of
        these assemblies for one application has been fine, but this is going to
        become a PITA if we have to deploy them to any other application that
        needs
        them.
        >
        I'd like to do this without having the UI piece manage the copying of
        these
        DLLs from some server share.
        >
        So I've been looking into WCF and have been trying to return these
        templates
        from a method on a WCF Service. I keep getting some errors such as
        >
        "The socket connection was aborted. This could be caused by an error
        processing your message or a receive timeout being exceeded by the remote
        host, or an underlying network resource issue. Local socket timeout was
        '00:00:59.51900 00'."
        >
        I am figuring this has something to do with trying to serialize an object
        or
        objects that are deriving from UserControl which is not serializable. Am
        I
        correct? If I attempt to use BinaryFormatter on the collection of
        templates
        I get an error basically saying just that.
        >
        How can I host these templates and/or their types to the client
        application?
        I am trying to do this WITHOUT copying DLLs to the client.

        Comment

        • Andy

          #5
          Re: Remote Custom Types

          On Apr 7, 10:48 am, "sloan" <s...@ipass.net wrote:
          You can distribute an Interface to the client, and not the actual assemblies
          themselves.
          >
          so in assembly1.dll , you'd have
          IEmployee
          >
          and on the server you'd have
          assembly1.dll (also)
          and
          assembly2.dll
          Employee : IEmployee
          >
          and the client doesn't have to have the assembly2.dll or the Employee
          object.
          >
          I'm not sure if this helps or not. I wasn't clear on your post or needs.
          I don't think this will work; the client still needs to instantiate
          instances of the concrete classes for remoting to work.

          Comment

          Working...