Friday 5 December 2014

How to debug Sharepoint code?

Steps to follow to debug SharePoint code

  • Open the project solution in Visual Studio
  • Debug Menu -> Attach to Process
  • Select “Show processes from all users”
  • Select the “correct” w3wp.exe process that your web application runs under

    • How can we identify the correct w3wp.exe associated with the application pool which we are running from the listed processes



we can identify the correct process associated to the correct application pool by following the below steps:

Note: The worker process ID gets changed/reset each time the application  pool is recycled or reset

  1. Start > Run > Cmd
  2. Go To Windows > System32 > Inetsrv
  3. Run appcmd list wp 
  4. check the id associated with the application pool which we are looking for
  5. Now go back and attach to the w3wp process possessing the id associated with the application pool above
 
 
  1.  

No comments:

Post a Comment