You can use Windows Communication Foundation (WCF)
to call methods in your running application. It's somewhat fiddly to set up, but once you have it makes it very easy to call methods via RPC.
Note that the methods are called from a separate thread, so you'd need to marshal it to the UI calls if necessary (using Control.Invoke()
or Control.BeginInvoke()
for Windows Forms).
Also, see here for a simple example. As Adam says below, you will need to use named pipes as the transport mechanism, so when looking at that example bear in mind that instead of
new NetTcpBinding(),
"net.tcp://localhost:8000");
you will have something like:
new NetNamedPipeBinding(),
"net.pipe://localhost/YourServiceNameGoesHere"