From: Peter Duniho on
Tony Johansson wrote:
> Hi!
>
> Here I have a console program that is creating 5 app domain running an exe
> in each one.
> Now assume that I want to run 5 exe files called Foo.exe.
> If I instead only created one app domain and started 5 threads running the
> Foo.exe in each thread which solution od these two would be the best choice
> ?

Best choice given what goals?

As has been explained to you, the point of using the AppDomain is mainly
so that you can isolate data and the executing code.

If you need to have that isolation for each executing assembly, then
yes�an AppDomain for each thread is needed. Otherwise, it's not.

As far as I know, you can only retrieve the return value from the
assembly's entry point when you use ExecuteAssembly(). Frankly, it
seems to me that executing an assembly using the Process class gives you
at least as good isolation as an AppDomain would, is more
straightforward to use, _and_ allows for redirection of the standard
streams for the process (input, output, and error).

So the whole question seems a bit contrived to me.

Pete