Leonardo
Leonardo

Reputation: 11389

Running code in a separate process

I would like to know how can I set an operation (method, block of code, etc.) to run on a different PROCESS (not thread) in a way that if the main process crash the others will still be running. Un-monitorable, but running.

I was thinking I could "compile" the block of code in a different app and then execute the result, but that wouldn't be too elegant. Is there a better way?

Upvotes: 4

Views: 7587

Answers (2)

Joel Lucsy
Joel Lucsy

Reputation: 8706

Another option is use the same app/exe and pass command line parameters to signify what to run in the second instance.

Upvotes: 2

Daniel
Daniel

Reputation: 632

Unless you run a separate exe the way ms intends is to create a new appdomain and run the other code in there. http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

Upvotes: 1

Related Questions