Release policy for WcfService proxy dependencies in an object that has a PerWebRequest image

If I have a PerWebRequest object that has a wcf proxy dependency with PerThread style, there will be a container

  • a) use the same proxy instance after the container automatically releases the parent object?
  • b) releasing the PerWebRequest object will cause the proxy to exit every time?

If a), should I release the service explicitly to avoid leakage, or if b) is there any real benefit to using PerThread for a proxy server if this is the only place it is being introduced?

+6
source share
1 answer

Why would you do this? There is a very specialized lifestyle in the stream, and if you really need it, I suggest you avoid it.

Make the wcf proxy transition.

You do not need to release it. Here's how it works .

+1
source

Source: https://habr.com/ru/post/917815/


All Articles