开发者

Call function in Remotable class

I have a remotable class derived from MarshalByRefObject.I have two public functions in it say TestMethod1 and TestMethod2. I am invoking these from an HttpHandler and it works fine. Now I have added a new function TestMethod3 that is similar to the two methods mentioned before. But, while calling this function from the same handler and getting an exception which says "undable to find the .exe for this application", where the exe is the process in which the remote object runs.

class HttpHandlerClass : IHttpHandler
{
开发者_开发知识库    RemotingConfiguration.RegisterWellKnownClientType(typeof(RemoteClass),"ipc://completeurl");

    RemoteClass rc = new RemoteClass();

    if (condition1)
        rc.TestMethod1();

    else 
        rc.TestMethod3();
}

class RemoteClass: MarshalByRefObject
{
   public void TestMethod1(int a) { }
   public void TestMethod2(string b) { }
   public void TestMethod3(string c) { }
}

No clue why. Seems to me I need to make some changes(dont know where) so that the TestMethod3 is recognized.

Any ideas?

Output: Could not load file or assembly 'Project.exe, version=1.0.0.0, Culture-neutral, publickeytoken=blahblah' or one of its dependencies. The system cannot find the file specified."

Just noticed, it is looking for an older version of the Project.exe and not the one whihc is being executed.


Use ICE instead? I struggled for months in the same situation as you, then ended up solving everything within a week when I switched architectures.


This is just a wild guess, but I've run into this issue before with remoting.

Are you sure the .exe you're remoting to is up to date? It's possible you didn't copy a compiled file to the expected location, and then the old methods would still work, but the new one will break completely...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜