Static methods can not be called remotely
Static methods can not be called remotely
The client application can not access to static methods / properties / fields remotely. Since you access a static method using CLASSNAME.STATICMETHOD, instead of OBJREF.STATICMETHOD, there’s no proxy involved. So access to static methods always takes place in the client’s context.
But you can add a thin non-static wrapper around each static method in order to remote calling.
Take the following code snippet as an example:
public class MyClass : MarshalByRefObject
{
public static void DoSomething (...) // Can not be called remotely
{
...
}
public void DoSomethingWrapper (...) // Can be called remotely
{
DoSomething (...);
}
}
Refer to the articles as follows to get more information:
http://www.cnblogs.com/rickie/archive/2004/10/22/55292.html
2. 尝试RemotingSqlHelper的若干问题,
http://www.cnblogs.com/rickie/archive/2004/10/13/51500.html