English 中文(简体)
Determine which w3wp.exe process belongs to which App Pool in Windows 7 / IIS7.5?
原标题:

I ve recently upgraded my development machine from Windows XP to Windows 7. How can I tell which w3wp.exe process belongs to which App Pool on a desktop running Windows 7?

But what about on my desktop?

最佳回答

If you open IIS Manager, go to the root node in the tree on the left that represents your computer (should be labeled as your computer name).

In the Features View to the right, you ll see a section called IIS. Under that you ll see Worker Processes. Select that and it should show you all running worker processes and some basic info, including ProcessId.

You can correlate that ProcessId to the matching process in the Processes tab in Task Manager (showing processes from all users, and including the ProcessId column in the results).

问题回答

You can also go into Task Manager and add the PID and Command Line columns to see the information you need.

enter image description here

The blacked out content contains the names of the individual processes.

I find this workflow just slightly less cumbersome than having to navigate away from what I may be looking at in IIS just to see this information (to then have to navigate right back to where I was).

I know this is an old post, but here is a way to enumerate the app pool and process IDs using C# code.

void Main()
{
    using (var serverManager = new ServerManager())
    {
        foreach (var appPool in serverManager.ApplicationPools)
        {
            string.Format("App pool name = {0}", appPool.Name).Dump();

            foreach (var workerProcess in appPool.WorkerProcesses)
            {
                string.Format("Process id = {0}", workerProcess.ProcessId).Dump();
            }
        }

        "Done".Dump();
    }
}

Make sure you reference Microsoft.Web.Administration.dll in %WINDIR%System32inetsrv.

If you don t have LINQPad, replace the dumps with Console.WriteLine(s)

There are two ways in which I prefer "task manager" version.

By task manager,

Add "command line" column as shown in the images.

enter image description here enter image description here

By PowerShell,

cd C:WindowsSystem32inetsrv
.appcmd list wp

enter image description here





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签