views:

48

answers:

2

Hi Guys,

I've written an event handler for sharepoint 2010 site using visual studio 2010 . I had attached a breakpoint to the code and followed the process which i had done in visual studio 2008.

It is to use the Attach to process option and select the w3wp option.

The event gets attached but the breakpoint is not firing.

I ve checked the site collection and checked the MAnage site settings to see if the event handler is enabled. It is enabled. I tried to disable and enable it again. Even now its not firing.

Also i tried to clean the build solution and re built it . The debugger is not firing.

Do post a reply

Thanks in advance Baradhwaj.PC

A: 

Are the PDB files in the path in which you are debugging? Without the PDB files, I think Visual Studio will be unable to link your code to the breakpoints.

It Grunt
+1  A: 

Here are a few things to check:

Are you attached to the correct process?

  • Using appcmd.exe list wp on the server (IIS7+) can be a useful way to determine which process ID belongs to which App pool. If you attach to the wrong process ID, even if it is the right name, the breakpoint won't fire.

Are your PDB's installed with the .dll's?

  • When I use GAC-based deployments, I often use a PowerShell script to copy my PDB files into the GAC folder where the assembly lives, usually something like C:\WINDOWS\assembly\GAC_MSIL\MYLibrary\1.0.0.0_publickeytoken.
  • When using bin-based deployments, it is sufficient to ensure the pdb is also in the bin folder.

While debugging, check the "Modules" debug window.

  • Find your assembly to determine whether debug symbols were loaded. If they are not, read the reason why. Note that you may need to invoke your code at least once for the assembly to get loaded.
  • Sometimes, it might mention that the pdb version doesn't match the assembly. This might happen if you built and deployed without pushing out a new pdb, even if you made no changes to the code. If this occurs, just redeploy a freshly-built assembly and pdb.
kbrimington