Shared DLL

O

Osvaldo Bisignano

Program1.exe and Program2.exe reference Library.dll, which only contains a
class with static methods and properties.

Modifying a value of Library.dll from Program1.exe, will change when I read
that value from Program2.exe?
If not... must I use remoting to achieve this?
Can I use Diagnostics.Processes?
Suggestions?

Thanks everybody
 
N

Nicholas Paldino [.NET/C# MVP]

Osvaldo,

The values in Program1 and Program2 will be different if accessing the
same dll. Static values are limited to the app domain that the assembly is
loaded in, and the two executables are definitely running in different
application domains.

Like you said, you can get around this using remoting, and use a shared
instance. You might also want to consider using a component derived from
ServicedComponent. You can have a pooled component with a min pool size of
one, and a max pool size of one, effectively creating a singleton.

Hope this helps.
 
O

Osvaldo Bisignano

That's great Nicholas. Thank you. I wonder what are those Application
Domains exactly, i'll look for the documentation but if you can give me some
introduction about them and how can i load differents assemblies into a same
AppDom.
The idea is to get around the "modules" in different exe's working together
scenario.




Nicholas Paldino said:
Osvaldo,

The values in Program1 and Program2 will be different if accessing the
same dll. Static values are limited to the app domain that the assembly is
loaded in, and the two executables are definitely running in different
application domains.

Like you said, you can get around this using remoting, and use a shared
instance. You might also want to consider using a component derived from
ServicedComponent. You can have a pooled component with a min pool size of
one, and a max pool size of one, effectively creating a singleton.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Osvaldo Bisignano said:
Program1.exe and Program2.exe reference Library.dll, which only contains a
class with static methods and properties.

Modifying a value of Library.dll from Program1.exe, will change when I read
that value from Program2.exe?
If not... must I use remoting to achieve this?
Can I use Diagnostics.Processes?
Suggestions?

Thanks everybody
 

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