Igal
Igal

Reputation: 1114

Sharing a static dll between WCF client apps

We building a static dll which is consuming a WCF services (has a service reference to a WCF service).

The static dll has local static variables which critical for the process.

The dll will be consumed by more then one type of GUI.

  1. a WPF user control.
  2. stand alone WPF application

Each one will have dozen of clients.

The question: is it possible to use one dll for all the clients by putting the dll to shared folder? Or can you suggest other method?

Thanks.

Upvotes: 1

Views: 657

Answers (3)

Aliostad
Aliostad

Reputation: 81660

Correct me if I am wrong but I assume you not only need need to share the same DLL, but the same state/values across multiple clients.

If DLL is loaded by several clients each in its own process, then they will not be sharing the static information.

Static state/variables are shared within the same AppDomain only. So if you are trying all these various clients to be able to access the same shared state, loading the DLL from a shared location will not help.

One solution to using shared information across multiple applications is having a services (could be WCF) providing shared state.

Upvotes: 4

chris
chris

Reputation: 2621

I'm not entirely sure what you mean by "static DLL". Linguistically speaking this is an oxymoron (DLL means "dynamic-link library"). If you are referring to something like static linkage, such a thing is not directly supported by .NET (AFAIK).

Upvotes: 0

spender
spender

Reputation: 120498

You could always register the assembly in the GAC.

Upvotes: 1

Related Questions