473,465 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Remoting a UserControl from an AppDomain/COM+ server?

2 New Member
So, the situation is that we have a poorly-executed UserControl that relies on a number of singletons in its assembly that unfortunately, over time, began acquiring the state of the control. Therefore, among other problems, we now can't have more than one instance of this control in a given application.

Obviously, refactoring to move the state in question back where it belongs is the most desirable choice, but we're also exploring other options that wouldn't cause so many ripples in our codebase (meaning, time-consuming refactoring, retesting, redeployment, etc.).

Two possibilities that seemed hopeful were to instantiate the control in question in either (a) subordinate AppDomains within our application or (b) out-of-process COM+ servers installed on the same machine (colocated). In both cases, factories would be obtained from the client application that would issue the control at runtime, and the static data (unfortunately) related to each instance would be isolated.

Designing both of these was very simple -- AppDomains and out-of-process COM+ servers are dead easy in C#/.NET -- but in both cases we get back proxy objects (different variants, but still .NET proxies) that we can't add to a control container in the client application, whether or not do it in the UI thread (via Control.Invoke).

In the case of the AppDomain approach, non-serializable fields, such as "Parent", don't appear to be exposed through the proxy so it's basically unusable. In the case of the out-of-process ("Server") COM+ server the UserControl comes back but isn't add-able with the following exception:

"...An unhandled exception of
type 'System.Runtime.Remoting.RemotingException' occurred
in mscorlib.dll

Additional information: This remoting proxy has no
channel sink which means either the server has no
registered server channels that are listening, or this
application has no suitable client channel to talk to the
server..."

...now, from the little that I have read about event sinks, it seems plausible that I could wire up one or more event shims and get this to work, but am I just wrapped around the axle here? I can't believe this should be that complicated, so I've come to the conclusion that I'm just missing another, better approach to this problem.

There are other things that have occurred to us, for example using thread-local keys to cause singleton accessors to deal out instances rather than one instance, but these "singletons" are both nested and numerous, so it's not nearly as simple as it sounds -- more productive to refactor correctly at that point.

I look forward to your responses, and please let me know if I may provide any additional information.
Apr 4 '07 #1
1 1974
mcoyote
2 New Member
I might add, BTW, that this "control" is almost as sophisticated as a complete web browser -- as in, very -- so there are hundreds of places where this static data is touched in various ways, quite deep call stacks, and both background threads and windows message filtering.
Apr 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Michael Culley | last post by:
In vb6 it was possible to create an exe as an activeX exe and communicate between 2 apps. Now we have remoting which requires opening a tcp port to listen on, which seems kinda crappy cause another...
5
by: Sam Martin | last post by:
Hi All, I've got a problem where my application loads an assembly in the running AppDomain when it shouldn't. Ok, I've got a RemotingHost application that configs the remoting stuff and...
6
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or...
0
by: Striped | last post by:
<crosspost in dotnet.framework.remoting> I have a remote configuration: a client and a server that hosts a library. This library unloads/loads another dynamic assembly in a separate domain each...
5
by: LGHummel | last post by:
I'm trying to host a remoting app in IIS and am getting the following error: Failed to execute the request because the ASP.NET process identity does not have read permissions to the global...
2
by: Mark | last post by:
Hi, I was wondering if anyone could point me in the right direction here. I've got a remote object that controls the dataset generation for our system reports. This all works fine at the moment...
4
by: Rich | last post by:
Can anyone suggest a good (current) tutorial on how to do basic remoting with C# (2005 express edition)?
1
by: hocker | last post by:
I have created a client-server application using .NET remoting in C#. The client initiates a call to the server then subscribes to events from the server, using an abstract class which contains the...
3
by: Piotrekk | last post by:
Hi I have a problem with my server which is not visible after netstat -na command. 1. remote class library compiled to dll and registered to GAC namespace RemoteClass { public class...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.