473,786 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

events of a remoted object

Dan
I am having a problem trying to assign event handlers to the events of
a remoted object. I have one program that registers the object for
remoting, Another that connects and calls methods on the object and a
third that connects to the object and waits for events. The error
occurs when I try to assign event handlers to the remoted object's
events in the third program (Listener).

hubListenerConn ection.ContextR equest += new
Hub.ContextRequ estEventHandler (hubListenerCon nection_Context Request);

This line throws a System.Security .SecurityExcept ion

Additional information: Type System.Delegate SerializationHo lder and
the types derived from it (such as System.Delegate SerializationHo lder)
are not permitted to be deserialized at this security level.

The Hub (inherits MarshalByRefObj ect) object events are declared as
follows:

public delegate void ContextRequestE ventHandler(obj ect sender,
EventArgs.Conte xtRequestEventA rgs e);

public event ContextRequestE ventHandler ContextRequest;

protected virtual void
OnContextReques t(EventArgs.Con textRequestEven tArgs e)
{
if (ContextRequest != null)
{
ContextRequest( this, e);
}
}

The custom EventArgs are declared with [Serializable] as is the
listener.

Any help with what I am doing wrong to get this error and what I can
do to make this system work?

Thanks,
Dan
Nov 16 '05 #1
2 4427
Dan,

Check out the article on CodeProject.com titled ".NET Remoting: Passing
through the obstacles path from version 1.0 to 1.1", which details how to
deal with this issue (it consists mainly of setting the type filter level on
the client and server). It is located at (watch for line wrap):

http://www.codeproject.com/csharp/Pa...ingArticle.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dan" <da************ **@srs.gov> wrote in message
news:45******** *************** ***@posting.goo gle.com...
I am having a problem trying to assign event handlers to the events of
a remoted object. I have one program that registers the object for
remoting, Another that connects and calls methods on the object and a
third that connects to the object and waits for events. The error
occurs when I try to assign event handlers to the remoted object's
events in the third program (Listener).

hubListenerConn ection.ContextR equest += new
Hub.ContextRequ estEventHandler (hubListenerCon nection_Context Request);

This line throws a System.Security .SecurityExcept ion

Additional information: Type System.Delegate SerializationHo lder and
the types derived from it (such as System.Delegate SerializationHo lder)
are not permitted to be deserialized at this security level.

The Hub (inherits MarshalByRefObj ect) object events are declared as
follows:

public delegate void ContextRequestE ventHandler(obj ect sender,
EventArgs.Conte xtRequestEventA rgs e);

public event ContextRequestE ventHandler ContextRequest;

protected virtual void
OnContextReques t(EventArgs.Con textRequestEven tArgs e)
{
if (ContextRequest != null)
{
ContextRequest( this, e);
}
}

The custom EventArgs are declared with [Serializable] as is the
listener.

Any help with what I am doing wrong to get this error and what I can
do to make this system work?

Thanks,
Dan

Nov 16 '05 #2
Dan
Thank you Nicholas, that example was very helpful. I now have the
system up and working. Though the event repeater being created by the
client and then remoted to the server works, the whole system would be
so much cleaner if the clients could subscribe to events of the server
object directly. Does anyone know if this will change with whidbey?

-Dan

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:<eF******* *******@TK2MSFT NGP12.phx.gbl>. ..
Dan,

Check out the article on CodeProject.com titled ".NET Remoting: Passing
through the obstacles path from version 1.0 to 1.1", which details how to
deal with this issue (it consists mainly of setting the type filter level on
the client and server). It is located at (watch for line wrap):

http://www.codeproject.com/csharp/Pa...ingArticle.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dan" <da************ **@srs.gov> wrote in message
news:45******** *************** ***@posting.goo gle.com...
I am having a problem trying to assign event handlers to the events of
a remoted object. I have one program that registers the object for
remoting, Another that connects and calls methods on the object and a
third that connects to the object and waits for events. The error
occurs when I try to assign event handlers to the remoted object's
events in the third program (Listener).

hubListenerConn ection.ContextR equest += new
Hub.ContextRequ estEventHandler (hubListenerCon nection_Context Request);

This line throws a System.Security .SecurityExcept ion

Additional information: Type System.Delegate SerializationHo lder and
the types derived from it (such as System.Delegate SerializationHo lder)
are not permitted to be deserialized at this security level.

The Hub (inherits MarshalByRefObj ect) object events are declared as
follows:

public delegate void ContextRequestE ventHandler(obj ect sender,
EventArgs.Conte xtRequestEventA rgs e);

public event ContextRequestE ventHandler ContextRequest;

protected virtual void
OnContextReques t(EventArgs.Con textRequestEven tArgs e)
{
if (ContextRequest != null)
{
ContextRequest( this, e);
}
}

The custom EventArgs are declared with [Serializable] as is the
listener.

Any help with what I am doing wrong to get this error and what I can
do to make this system work?

Thanks,
Dan

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1908
by: Nick | last post by:
Is there a way that if I host my remoted object in IIS (not having to mess with encryption & authentication via a custom sink) that the server can raise events and the clients can detect them? If so what would be the best way to go about having the client handle an event that is fired from the server...I am currently using SingleCall and not Singleton.
3
1315
by: jabailo | last post by:
Can a SQL 2000 server raise a .NET event? -- Texeme Textcasting Technology http://www.texeme.com
8
1413
by: wobbles | last post by:
Hi Everybody, How do I go about listening to events published by other apps? I know that my events are working internally (ie within my client), but when I subscribe to an event published by a different client, it doesn't work. I feel like I'm missing something. Please point me in the right direction.
1
1709
by: Steve Drake | last post by:
All, I have a WEBPAGE that needs to pass the current credentials to a .NET remoted object so this can pass the credentials to a SOAP WEBSERVICE (All written in C#) But I cannot see how I pass credentials to the remoted object, any ideas? If there was no remote layer then I could just do :
3
2506
by: Grant Schenck | last post by:
Hello, I have a Windows Service developed in C# .NET. I'm making it a remote server and I can, via an IPC Channel, expose methods and call them from a client. However, I now want my remoted object to be able to invoke a method on my server object and given that the object is built in a C# Class DLL shared between the client and server I'm not sure how to get access to the server object from the remoted object. So, what techniques...
1
1520
by: Dave Evans | last post by:
I have a number of remotable DLLs, which are hosted by a Windows Service. The Windows Service simply registers the remotable DLLs using RemotingConfiguration.Configure. The configuration file is as follows: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application name="UniConnect"> <service> <wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCRegistry, ZUCRegistry"...
0
1267
by: =?Utf-8?B?Sm9obiBXLg==?= | last post by:
A client application connects to a TCP-remoted object from a service on localhost for method invocations and events. It works as advertised. But... if the network cable (LAN) gets disconnected, the event subscriptions to the localhost server are lost because "The connection was forcibly closed...". If the remoting proxy had also gone away, the client would detect it and begin trying to re-establish the connection. But it doesn't; the...
0
1053
by: VishalSimon | last post by:
Remoting Error can not access property or method of proxy object on internet, works fine for LAN Hello, here is my some remoting code Code Snippet Remoted Class: namespace Server
1
1625
by: almir | last post by:
hi, i need to notify clients about change that happened on server. there will be about 2000 clients each will have my service running in it, what would be the best way to notify only few of them them (not all) about event on server. i think that using .net events is not an option in this case and I do not want to pool frorm client or leave open ports on client :)
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.