There are 2 cases right here:
- Debugging Web Part has been developed on your sharepoint site server.
- Debugging Remotely Web Part has been developed on your local machine.
- To be able to debug your code(web part) you need to verify that your webpart DLL located at website BIN directory(in our case"C:\Inetpub\wwwroot\wss\VirtualDirectories\1234\Bin").
- Verify your assebly is registered as safe control at web.config file - If you want to deploy your webpart to "http://sp:1234/" you should modify web.config file of this site "C:\Inetpub\wwwroot\wss\VirtualDirectories\1234\web.config"- to know how to do this kindly open up this link.
- Open up your Webpart project in VS.NET.
- Set breakPoint wherever you want in your code.
- Select from Debug menu --> Attache to Process.
- Pop up box will appear listing all current running processes, select Process "w3wp.exe". may be you will see more than one from this process, select the one running with your username appear in User Name column.
- Now you are ready to debug your application.
- Get back to your page you deploy this webpart.
- As soon as you open the page contains the wepart, your cursor automatically goes to VS.NET project (webpart project) and will stop at your code line you set break point at.
- Effortless and useful.
wait for second case...it will be soon.