You should not be rude in your comments.
Now try this:
On the client: create a client side proxy with the following few lines
// Create the proxy:
EndpointAddress ep = new EndpointAddress("net.pipe://localhost/SomeAddress/PipeEndpoint/");
IMyinterface instance = ChannelFactory<IMyinterface>.CreateChannel(new NetNamedPipeBinding(), ep);
// now use it:
instance.SendMessage();
On the server side, run the server and register the object to do the work:
ServiceHost host = new ServiceHost(new MyClass(), new Uri("net.pipe://localhost/SomeAddress"));
host.AddServiceEndpoint(typeof(IMyinterface), new NetNamedPipeBinding(), "PipeEndpoint");
host.Open();
The MyClass code on the server side too:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class MyClass : IMyinterface
{
public void SendMessage()
{
// do something here
}
}
And the interface should be in separate project referensed by both, client and server projects:
[ServiceContract]
interface IMyinterface
{
[OperationContract]
void SendMessage();
}
Remark: when I say "Client", I mean the one who sends the message. Server is the one who receives the message. I think in your architecture is the opposite, so I wanted to be clear with my terminology.
I hope it helps