Question

I have a .Net 3.0 application that needs to pass an integer to another program on the same machine. I was using a WCF service to do this, but ran into user rights issues when trying HOSTING the service on the local box. Any thoughts on how to accomplish this woudld be greatly appreciated.

Thanks,

Dave

Was it helpful?

Solution

WCF is still the way to go here.

Generally, for inter-process communication on the same machine, you would use the named pipe channel. If you are not using this, I suggest you do and then determine what the error in hosting is.

If both programs have message loops that are being processed, and you are sending an integer, you could use a call to SendMessage through the P/Invoke layer as well, but that's only because you are sending data that is equal to or smaller than what SendMessage will allow. Larger messages will require something like WCF.

OTHER TIPS

.NET Remoting is a way to pass messages between programs.

How were you hosting? Note that a non-admin program using http will need permissions to use the port (in http.sys). This is via netsh (Vista) or (IIRC) httpcfg (XP).

See here, for example.

WCF is the way to go. You should use NetNamedPipeBinding to secure in same machine communication.
More about WCFBindings https://msdn.microsoft.com/en-us/library/ms730879(v=vs.110).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top