How to run / invoke an application on server.

  • Thread starter Thread starter Vinay
  • Start date Start date
V

Vinay

Hi ,
I am having server and client. Client is a test machine.
I want to invoke the application binary which resides on
server from client machine. The binary is created using
C#. Please note that I know the administrative password
for the server. Can some one help?

TIA,
Vinay
 
Couple ways. Here is three:
1) get pexec from winternals.com that can start exes on remote boxes.
2) Create a Remoting Host or web service that has a "int StartApp(string
appPath)" method that uses process.start and can return an exit code, etc.
3) Schedule it.
 
Vinay,

You can not use the Process class to invoke a process on another machine.
But you do have several options:

1) Make the server app a .NET remoting server (turn it into a Windows
Service, or make it a console app that you leave running at all times, or
host it in IIS). Make remoting calls from the clients to the server
application.

2) Make the server app a web service and write your clients to consume the
web service.

3) Write a separate .NET remoting server that can launch applications on
that machine based on client requests.

4) No doubt, other possibilities I haven't thought of ;-)

In my view, (1) using a binary formatter and TCP protocol is the best and
most efficient choice if server and clients all run under the .NET CLR
especially if all clients are on the same network and inside the same
firewall as the server. (3) is a reasonable alternative if the server app
is not a CLR managed app. Your remoting server can use the Process /
ProcessInfo classes to launch the unmanged app, pass arguments to it, talk
to it as an ActiveX server if appropriate, etc. (2) Is a possibility if
clients are oustide the server's firewall or out on the public Internet.

--Bob
 
Back
Top