While working with SharePoint 2010 development using Visual Studio 2010 you might encounter the following error message.
The error could occur while using the following:
· Debugging a Web Part application
· Debugging a Console application
· Debugging a Workflow application
We can explore some of the solutions involved. You can try the following solutions in the order as they occur:
1. Reset IIS
2. Attach Debugger to W3WP Process
Open the Windows Run dialog from Start Menu (Windows Button + R)
Enter the command IISRESET and press enter key. This should reset the Internet Information Services process.
Wait until the command is finished and Retry Debugging.
Attach Debugger to W3WP Process
The debugging is performed through the W3WP process. While the project is being deployed and opened in the browser, from Visual Studio 2010 open the Debug > Attach to Process dialog.
You can locate the w3wp.exe process from the list as shown above. If the particular process is not found you can check the Show processes from all users check box.
If there is multiple w3wp.exe processes listed, you can find the exact process using the ID.
Open command prompt, go to folder c:\windows\system32\inetsrv and enter the following command appcmd list wp
The result of the command shows the ID of the worker process. You need to select the ID it based on the SharePoint IIS Application and Port.
To test whether debugging is working, place a break point in the code and you should get the break point hit while execution.
In this article we have explored an occasional error scenario associated with debugging and the solutions for it.