Receive events from other project

A

Alejandro

Hi!
I have 3 projects. One is class library type, which has an static class that
contains an static event, and a static method that fires the event. The
others two projects are Windows Appliocation type (App1, App2). The App1
subcribe to receive notifications from the ClassLibrary static event. When
de App2 call the static method that fires the event, the App1 never receive
the notification.
Is possible do what i want?
Thanks

PD: Sorry for my bad english =(....
 
P

Peter Rilling

My guess would be because each app runs in its own process and cannot share
memory. Therefore when you bind the handler in one app, it is not seen by
the other app because each app has its own copy of the variable.

I doubt this is possible with simple event handling. You may need to use
something like remoting to communicate between the apps.
 
J

Jon Skeet [C# MVP]

I have 3 projects. One is class library type, which has an static class that
contains an static event, and a static method that fires the event. The
others two projects are Windows Appliocation type (App1, App2). The App1
subcribe to receive notifications from the ClassLibrary static event. When
de App2 call the static method that fires the event, the App1 never receive
the notification.
Is possible do what i want?

Not without using remoting. You need to understand that static members
are still scoped to the AppDomain, and when you run two processes,
you'll get (at least) two AppDomains.
 
G

Guest

Hi, Alejandro,

Did you find a way to do this? I have a similar problem. I wonder how to use
..net remoting to do it.

Thanks

Dave
 

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

Top