3

I can come up only with serialization, using of WCF, etc. But is there the standard common way for communication between 2 processes in .Net?

UPDATE: What I actually mean how to communicate between 2 processes locally when I do not need to use WCF, Remoting and network at all. Are there some ways of doing it? And I am interesting in more elegant ways than storing data to HDD or to database.

Oleg Dudnyk
  • 1,009
  • 1
  • 10
  • 22
  • 1
    What type of communication? Do you mean sending commands back and forth, or are you only sending data? – Jordan Aug 07 '11 at 05:08
  • Local or remote? Reliable or best effort? Synchronous or asynchronous (queued)? Point to point of pub-sub? One size does not fit all. – Remus Rusanu Aug 07 '11 at 05:08
  • @Remus Rusanu: locally, but is it different ways depending on your next options? – Oleg Dudnyk Aug 07 '11 at 05:12
  • @Jordan: I mean local communication, not remote. – Oleg Dudnyk Aug 07 '11 at 05:13
  • Re the Update: still no context (no 'why') but only some unsupported rejection of possible solutions. – H H Aug 07 '11 at 06:28
  • @ Henk Holterman: Sorry I thought it was clear from the question that I do not expect answers about WCF and storing data. My first sentence in the question "I can come up only with serialization, using of WCF, etc." seems to be clear. – Oleg Dudnyk Aug 07 '11 at 06:35
  • @poke dude, you closed this question as duplicate while citing a closed question. so, this is catch-22. How to add an answer? eh? – T.S. Apr 25 '19 at 15:28
  • 1
    @T.S. You don’t. This topic is not asking for answers because it is off-topic for the reason that is given in the linked question. – poke Apr 25 '19 at 15:37
  • @poke Original is off-topic - sure. however, it has tremendous interest - 79K. Do you want a law or do you want justice? – T.S. Apr 25 '19 at 15:53
  • 1
    @T.S. Interest is not relevant here. Feel free to go to meta if you disagree with that. – poke Apr 25 '19 at 18:31

2 Answers2

4

With no other information, I would suggest using WCF with a named pipes configuration:

What is the best choice for .NET inter-process communication?

Community
  • 1
  • 1
Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55
  • which additional information is needed? – Oleg Dudnyk Aug 07 '11 at 05:24
  • 2
    Just a few of the concerns raised above - do you have needs for message queuing, pub/sub, etc. If you're just looking to invoke methods across processes, WCF is the recommenced method. You'll probably run into a lot of ".NET Remoting", but as Anuj mentioned, it's kind of antiquated at this point. – Justin Beckwith Aug 07 '11 at 05:34
  • I do not need message queuing, pub/sub, etc. but of course it is interesting to know what if I would? Does it mean that I need to use another ways (not WCF)? – Oleg Dudnyk Aug 07 '11 at 05:41
  • 1
    I was about to go on a long diatribe talking about other non .net systems I would use until I came across this: http://blogs.msdn.com/b/tomholl/archive/2008/05/17/building-a-pub-sub-message-bus-with-wcf-and-msmq.aspx – Justin Beckwith Aug 07 '11 at 05:45
  • Thank you for article, but nothing new for me there. – Oleg Dudnyk Aug 07 '11 at 06:05
  • 1
    @gorik: WCF is the MS recommendation. What more are you looking for? – Kramii Aug 07 '11 at 06:25
  • @Kramii: I was looking for this answer. Thank you. So the most suitable way - using of WCF. OK. – Oleg Dudnyk Aug 07 '11 at 09:41
1

You can also look at .NET Remoting. But for all intents and purposes you shouldn't be using it unless you have explicit requirements that are satisfied by remoting like...in-process, cross-appdomain communication.

I would just look at WCF's NetNamedPipeBinding. It sounds like it's exactly what you want: http://www.codeproject.com/KB/WCF/wcfipcsample.aspx

Also it seems this question has already been answered:

Interprocess communication for Windows in C# (.NET 2.0)

C# - WCF - inter-process communication

Community
  • 1
  • 1
Anuj
  • 3,134
  • 13
  • 17
  • I knew about WCF, that is why I mentioned it in the question. What I have asked - is there COMMON way of doing it. In other words do Microsoft recommends something for doing it? – Oleg Dudnyk Aug 07 '11 at 05:30