0

I have a windows service that has a function, lets say

Sum(int a,int b)

How can I use this function from my windows form application?

Mohammad Rashid
  • 138
  • 3
  • 16
  • I have created the service and application... but no idea how to communicate between them.. – Mohammad Rashid Mar 18 '17 at 04:45
  • Googled for "C# call method in windows service": http://stackoverflow.com/questions/1979016/how-to-call-method-from-running-windows-service – Joshua Shearer Mar 18 '17 at 04:54
  • Possible duplicate of [How to call method from running windows service](http://stackoverflow.com/questions/1979016/how-to-call-method-from-running-windows-service) – rene Mar 18 '17 at 06:58

1 Answers1

3

Do not use .NET Remoting. That technology is out-of-date.

If you are wanting to invoke the Sum() method in the Windows service from the client-side application, Windows Communication Foundation (WCF) would be a logical choice. You can view my answer here for an example of how this might be done.

Community
  • 1
  • 1
Matt Davis
  • 45,297
  • 16
  • 93
  • 124