Questions tagged [realproxy]
21 questions
18
votes
1 answer
Under what conditions will `RealProxy.GetTransparentProxy()` return `null`?
The documentation at http://msdn.microsoft.com/en-us/library/system.runtime.remoting.proxies.realproxy.gettransparentproxy%28v=VS.100%29.aspx doesn't indicate a scenario where GetTransparentProxy will return null, but I'm getting a null back when I…

David Pfeffer
- 38,869
- 30
- 127
- 202
8
votes
2 answers
How to wrap existing object instance into DispatchProxy?
I'm looking for RealProxy replacement in .NET Core, and this issue forwards me to DispatchProxy.
It has simple API, but it's unclear, how to wrap existing object into proxy.
E.g., having this interface:
interface IFoo
{
string Bar(int…

Dennis
- 37,026
- 10
- 82
- 150
8
votes
1 answer
What is the Correct Way to Dispose a WCF Proxy?
I have been struggling with WCF Proxies. What is the correct way to Dispose a WCF Proxy? The answer is not trivial.
System.ServiceModel.ClientBase violates Microsoft's own Dispose-pattern
System.ServiceModel.ClientBase does implement…

Xharlie
- 2,350
- 3
- 19
- 39
6
votes
1 answer
Wrapping __TransparentProxy of RemotingProxy in another Proxy throws RemotingException
Goal
I have a couple of interfaces and some dlls that provide implementations for these interfaces. I want to load the implementation into a new AppDomain (so I can unload the dll later) and instatiate the implementation in the new AppDomain and…

prydain
- 365
- 3
- 11
5
votes
2 answers
C# RealProxy: generic methods?
I'm trying to handle a call of a generic method through a RealProxy, but I cannot seem to find the information about the actual type of the generic parameter used in the intercepted method call. An excerpt of the code:
public override IMessage…

Igor Brejc
- 18,714
- 13
- 76
- 95
4
votes
1 answer
Autofac and Cross-AppDomain Proxies
I am trying to register a cross-AppDomain proxy with Autofac.
The concrete type represented by the proxy implements the interface IServiceHost. Thus, the proxy should also, in order to allow calls to the proxy using that interface to work.
I try to…

David Pfeffer
- 38,869
- 30
- 127
- 202
4
votes
1 answer
How to get the RealProxy when I know only the transparent proxy
I have a transparent proxy, for instance one generated by WCF:
ChannelFactory channelFactory =
new ChannelFactory(
new NetNamedPipeBinding(),
…

Gael Fraiteur
- 6,759
- 2
- 24
- 31
3
votes
0 answers
How to get ServiceChannelProxy or ServiceChannel from RealProxy
I want to access the State of the Channel. I'm receiving the __TransparentProxy which contains a RealProxy(rp). I'm able to access it using this function GetRealProxy()
But, I am still not able to get the Status from the Real proxy. I'll need to get…

Sailoosha
- 193
- 1
- 3
- 14
3
votes
2 answers
How to dynamically combine two interfaces to pass to RealProxy
In a call to the RealProxy base constructor, you pass the Type of the target object to be proxied. What I would like to do is dynamically add interfaces to the proxied type so that the resultant proxied type can be cast to the additional…

Jim
- 4,910
- 4
- 32
- 50
2
votes
1 answer
Throwing WCF Fault Exception from RealProxy of Service Contract
I have a C# application with a WCF backend and a UWP frontend. I have a service implementing my service contract. Everything works as expected if I catch exceptions on the services and re-throw them as Fault Exceptions.
Now I'm trying to clean up…

Connell.O'Donnell
- 3,603
- 11
- 27
- 61
2
votes
1 answer
Ref argument through a RealProxy
I need to call a method with ref-arguments through a RealProxy. I have isolated the problem down to the following code:
using System;
using System.Reflection;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
namespace…

Guge
- 4,569
- 4
- 35
- 47
2
votes
0 answers
How channels created with ChannelFactory can be cast into ICommunicationObject?
I'm wonder how the T channels created with ChannelFactory can be cast into ICommunicationObject?
The reason I'm asking this is because I started to wrote a simple ChannelProxy to manage faulted state, and recreate another channel automaticaly.
When…

mika91
- 53
- 7
2
votes
1 answer
Instancing a Proxied Class (RealProxy)
I'm trying to create a proxy using a RealProxy extension. I had no problem in forwarding calls and intercepting them. However, I also wanted to intercept the instantiation of the class being proxied, so I tried to override the instance creation in a…

hernanf
- 21
- 2
2
votes
1 answer
Using RealProxy to wrap multiple WCF connections
I am working on a project where our server communicate with several servers exposing the same interface (as in clustering). We use round-robin to select which server to send our request to. So far, we have been using Expression to call our…

bigfoot
- 455
- 5
- 12
1
vote
1 answer
C# - Allow Inheritance but Forbid Direct Use of Constructor
I want to allow inheritance, but forbid the direct construction of any of the inherited classes. Instead, I want to force the usage of the custom method New().
The goal is to make sure that every instance of inherited classes is a transparent proxy…

Mr.Yeah
- 1,054
- 2
- 9
- 21