Remote Custom Types

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.5190000'."

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.
 
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
 
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.

http://sholliday.spaces.live.com/blog/
9/27/2005
Leveraging Dot Net Remoting To Keep Your "Secret Code" Safe
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top