Display Name
Display Name

Reputation: 15101

If my asp.net application spawns a process, does the process runs inside the same application domain in which the asp.net application runs?

Based on my understanding:

  1. IIS invokes a single worker process for the whole asp.net applications on the server.
  2. The worker process contains a collection of application domains.
  3. Each application domain in the worker process corresponds to an asp.net application.

If my asp.net application spawns a process for each request, does the process runs inside the same application domain in which the asp.net application runs?

    Process p = new Process();

    p.EnableRaisingEvents = true;
    p.Exited += new EventHandler(p_Exited);

    p.StartInfo.Arguments = "-fmt=pdflatex -interaction=nonstopmode " + inputpath;
    p.StartInfo.WorkingDirectory = dir;

    p.StartInfo.UseShellExecute = false;
    p.StartInfo.FileName = "pdftex.exe";

    p.StartInfo.LoadUserProfile = true;

    p.Start();
    p.WaitForExit();

Upvotes: 0

Views: 557

Answers (2)

Fadrian Sudaman
Fadrian Sudaman

Reputation: 6465

The simple answer is no. When you start a new process, a new process space is created and it is independent of your app domain. The spawned process may or may not be managed code and run as an independently process. It may inherit the security context of its creator if appropriate setting is defined.

Upvotes: 2

Daniel Hilgarth
Daniel Hilgarth

Reputation: 174329

No. An AppDomain can't exceed the boundary of the process it is inside.
Furthermore, AppDomains are a concept from the .NET world. If pdftex.exe is a .NET application, it has its own AppDomain. If it isn't a .NET application, it doesn't have an AppDomain at all.

Upvotes: 1

Related Questions