When debugging asp.net by attaching w3wp.exe process, you often will see encounter the following error message, the web server process that was being debugged has been terminated by IIS.
This caused Internet Information Services (IIS) to assume that the worker process had stopped responding. Therefore, IIS terminated the worker process.
1. Open IIS manager.
2.Click application Pools>>select the application pool associated with the site>>and click Advanced Settings
3. Click Advanced Settings of the application pool and set the Ping Enabled property from True to False.
Now, reattach the process from Visual Studio, you should not get the error message.
When debugging SharePoint2010 project, you need to attach w3wp.exe process, however there are often quite a few of them and it is very hard to figure out which one to attach. Today, I will show you how to find out which process to attach using a tool called process explorer.
1. Download the process explorer and run it after you download it.
2. Find the w3wp.exe processes under wininit.exe right-click the columns header and click Select Columns.
3. Include Command Line under Process Image.
4. Now you can see your IIS site name next to w3wp.exe, in my case I’d like to attach the “SharePoint – BenDev80″.You can see the PID of the process is 2920.
5. From the above process you know the process ID you’d like to attach is 2920, you can then go ahead to attach the process from Visual Studio.