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?
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%\System32\inetsrv.
If you don't have LINQPad, replace the dumps with Console.WriteLine
(s)