471,049 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

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.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.
Apr 6 '07 #1
4 1266
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.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.
Apr 6 '07 #2
The short answer is you can't. The assemblies must be on both client
and server.

Apr 6 '07 #3

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
"rkozlin" <rk*****@discussions.microsoft.comwrote in message
news:6F**********************************@microsof t.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.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.

Apr 7 '07 #4
On Apr 7, 10:48 am, "sloan" <s...@ipass.netwrote:
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.

Apr 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by KV | last post: by
2 posts views Thread by gilberto ramirez | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.