I have been doing alot of reading about remoting, etc. but am still confused
and a little lost.
Problem: I have three applications that all use the same assembly (ie:
MyApp.dll). I want the assembly to be loaded only once (singleton?) and have
it shared between all the applications. So if for example I make a call
MyApp.SetNumber=2 in application #1, I should be able to make a call
MyApp.ReadNumber in application #2 and get back the value 2. (might be a bad
example here.....).
With application domains, etc this seems like a major pain to do this. Can
anyone help point me in a direction or even give a very basic example of a
shared DLL across different applications? Would it be better (if posslbe) to
make the DLL into a service and do the same thing?
BTW: This is all running on the same machine so it does not need to go
across the network.
Yves Tourchot - 09 May 2005 19:21 GMT
> I have been doing alot of reading about remoting, etc. but am still confused
> and a little lost.
[quoted text clipped - 12 lines]
> BTW: This is all running on the same machine so it does not need to go
> across the network.
Each process loads its own "instance" of the CLR witch in turn loads its own
"instance" of the various needed assemblies ie mscorlib, system, MyApp and
so on.
So it's not possible to different process to loads and uses exactly the same
instance of a given assembly.
But it still possible to share data between different process through the
uses of the same assembly. Take a look at the IsolatedStorage api.
Daniel Moth - 15 May 2005 04:53 GMT
Remoting can be used for your scenario. You'll need an exe (or use a
service) to host your dll.
With .NET 1.x, use binary over tcp. With v2.0, you can also use the new IPC
channel:
http://www.danielmoth.com/Blog/2004/09/ipc-with-remoting-in-net-20.html
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
>I have been doing alot of reading about remoting, etc. but am still
>confused
[quoted text clipped - 16 lines]
> BTW: This is all running on the same machine so it does not need to go
> across the network.