Pages

Showing posts with label attach to process. Show all posts
Showing posts with label attach to process. Show all posts

Sunday, 24 March 2013

How to increase the timeout for an app pool when attaching from Visual Studio

As a developer you have to attach to the w3wp process from Visual studio to debug your code. This is straight forward, from Visual studio > tools > Attach to Process. (Note: To find the correct w3wp process, refer to this post)

But the problem is that you never have enough time to step through your code as the pool recycles. In order to increase the time so the process is attached and you get a lot longer to debug your code, follow these steps:

  1. In your development environment, open server manager or open IIS manager
  2. Under application pools > right the correct app pool and click on advanced settings > Change these 2 settings:
  3. Ping Enabled: Set this to False and Ping Maximum Response Time (seconds): Set this to 4294967 (which is the highest you can set)

And that's it, now you will see that you can attach to correct process for lot longer.

How to find the w3wp ProcessId when attaching to process from Visual Studio


When debugging from Visual Studio, you have to attach to the correct w2wp process.

To find the right w3wp process on a windows server 2008 R2 running IIS 7.5, run the following command:

  1. Open command prompt (right click run as administrator)
  2. if not already at c:\windows\system32. navigate to the location by this command cd   c:\windows\system32\inetsrv
  3. use this command to get a list of all the w3wp process
    appcmd list wp
  4. Identify the correct process from the list

That's is, now you can attach to the correct process rather than attaching to all :)