开发者

.NET remoting problem

I have singleton object hosted under IIS. I can call any method in Singleton object without any problem. One method of singleton object returns a reference to another class object. When I try to call a method on this referenced object I get a message "Cannot connect to the server" e.g.

public class TestClass : MarshalByRefObject
{
  public void TestMethod()
  {
  }
}

public class SingletonClass : MarshalByRefObject
{
  public TestClass Test()
  {
     return new TestClass();
  }
}开发者_开发知识库


//Client calls example
SingletonClass c = Activating SingletonClass object here
var obj = c.Test(); //Succeeds
obj.TestMethod();  //Hangs and then I get msg "Cannot connect to the Server"

Please not that if I run claint and server on same machine there is no problem. If I run client on separate machine then I get this issue. The surprise is that one call succeeds and the other one fails. Both classes in same dll. What could be the problem? Any suggestion to look at security/permission settings?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜