Recently we have moved to Visual Studio 2010 for our SharePoint project. In Visual Studio 2008 we were using WSP builder to manage SharePoint deployment. After moving to Visual Studio 2010, we have used beta version of WSP 2010. We had converted our SharePoint projects successfully to VS 2010, we tested deployments and others are working great with VS 2010 and WSP 2010. However when we tried to start developing, we had found that w3wp process can’t be attached. We tried different approach, sometimes the attaching worked but only for the first time. If we detach the debugger and then try to attach again the debugger doesn’t work for the second time.
After Googling I had found another person Patrick Lamber has solved the problem in his blog. I’m reposting it in details hoping this might be helpful for someone.
- Click Debug => Attach to Process. The “Attach to Process” dialog comes up.
- In the “Attach to Process” dialog, click Select button, which will show “Select Code Type” dialog as shown below: Figure 1: Change Code Type dialog
- In the “Select Code Type” dialog, select “Debug these types of code” and then check option for “Managed (v2.0..)
- You are done. Now you can try attaching debugger. Hope it’ll work.