http://msdn.microsoft.com/en-us/library/system.runtime.remoting.proxies.realproxy.gettransparentproxy%28v=VS.100%29.aspx的文档没有指出GetTransparentProxy将返回null的场景,但是当我调用它时,我会得到一个null。
在什么情况下会导致这种行为?
发布于 2010-12-24 01:50:05
不要紧,已经解决了。让您的RealProxy派生类使用要代理的类型调用基构造器是至关重要的。在我的例子中:
public class MyProxy<T> : RealProxy
{
public MyProxy()
: base(typeof(T)) // this was missing
{
...
}
...
}https://stackoverflow.com/questions/4521122
复制相似问题