开发者

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开发者_如何学JAVA method?

Thanks.


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.


You could always register the assembly in the GAC.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜