I am pasting the code snippet of my client and server below
Code of Server:
RemotingConfiguration.Configure( "rpcserver.exe.config" );
TcpServerChannel channel = new TcpServerChannel(rs.mPort);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(RemoteServerObject),
"ToolCommand",
WellKnownObjectMode.SingleCall);
Code for Client:
ManagementScope obScope = new ManagementScope("\\\\" + remoteServer +
"\\root\\CIMV2");
ManagementClass shareClass = new ManagementClass( "\\\\" + remoteServer
+ "\\root\\CIMV2:Win32_Process" );
object[] param = {"c:\\temp\\rpcserver.exe",null,null,null};
object response = shareClass.InvokeMethod( "Create", param );
}
I don't know anything about WMI, but I've used remoting a fair bit. As you say, if the server isn't running, then you get the error message. Are you trying to start up and shut down a remoting exe at will, or just run it?
Martin.
I want to start and stop the exe at will. When I start the exe manually
everything works fine. If I executed it through code using WMI I get this
error. R there any other ways other than WMI to execute an exe on the
remoted machine?
Thanks
"Martin Platt" <Marti...@discussions.microsoft.com> wrote in message
news:47DCF7F9-674C-46B8...@microsoft.com...
why you not host your server in windows service, and remotely start/stop
the service?
Sunny
In article <uoA7KRM...@TK2MSFTNGP12.phx.gbl>,
gokhal...@yahoo.com says...
I agree with what sunny is saying - see parallel posting.
I think by choosing the implementation you are, you're making it hard for yourself.
If you're remoting, and you have the two servers in there, you can also set properties in your executable as it is at the moment, so that it appears to unload, or actually to unload it.
I think you need to consider your design decisions, and question whether there are better, more dependable ways to achieve what you want to achieve....
By all means reveal there what where and why of your design, and we can try to help you?
Cheers,
Martin.
System.Security.SecurityException: Request for principal permission failed
what are the possible causes of the exception? and what r the resolutions?
Thanks for your help
Data
"Martin Platt" <Marti...@discussions.microsoft.com> wrote in message
news:9D8DD568-DC21-40C6...@microsoft.com...