I have class named worker, I want to create new instance of this class in a new process.
But I want to be able to communicate with this class after it will be open in a new process and being able to send and receive data.
What I want to do is that in any call to worker() a new instance will be open in a new process so I can see alot of worker.exe in my task manager.
I’ve done in before with vb com wrapper but now I want to do this only in C# and without COM,
Can I do this in the most basic way?
Example to class:
public class worker
{
public worker()
{
// Some code that should be open in a new process
}
public bool DoAction()
{
return true;
}
}
Example to main program:
worker myWorker = new worker();//should be open in a new process
bool ret = myWorker.DoAction();
You could expose your actions in WCF endpoints. Then, from one process, start another process. Then you can connect to the endpoint that that process exposes to communicate with it.
Typically, this is what WCF Named Pipes are used for.
Taken from link: