1

I have written an SharePoint EventReceiver (Windows SharePoint Services 3.0) and want to debug it with Visual Studio 2008 SP1, which runs on a different computer. I have tried the following steps:

  • Installing the event receiver (I know that this works because a log file proves that the code is executed).
  • Registering my event receiver class library in the GAC of the SharePoint server (built in Debug mode).
  • Starting Visual Studio Remote Debugging Monitor on SharePoint server.
  • Attaching to process w3wp.exe on SharePoint server from local machine.

Unfortunately Visual Studio tells me that the breakpoint I set will not be hit. I guess that when installing the assembly to the GAC the debug symbols (or whatever is needed for debugging) are lost.

What can I do to debug my event receiver? As far as I know the only way to extend SharePoint by custom assemblies is to deploy them to GAC - am I missing here something?

Best Regards
Oliver Hanappi

Alex Angas
  • 59,219
  • 41
  • 137
  • 210
Oliver Hanappi
  • 12,046
  • 7
  • 51
  • 68

3 Answers3

1

you could try manually copying your assembly's debug (.pdb) file to the c:\windows\assembly\MSIL\ASSEMBLYNAME\VERSION folder on the target machine and restart IIS.

Colin
  • 10,630
  • 28
  • 36
0

I just ran into this issue this morning. I was getting the same error about breakpoints not being hit. In my case, it was because I attached to the wrong w3wp.exe process. If you have multiple w3wp.exe processes running on the server - make sure you're attaching to the correct process for debugging.

As an aside - you don't mention running iisreset anywhere in your steps. After you copy your custom event received assembly to the GAC - make sure you run an iisreset so that the web server is picking up your changes.

Hope that helps!!

pmartin
  • 2,731
  • 1
  • 25
  • 30
0

This question is very old but I just want to share the following command that will assist in picking the right w3wp.exe process.

Assuming you have deployed and enabled your event receiver.

Execute this command on the commandline

%windir%\system32\inetsrv\appcmd.exe list wp

This will print the PID and an indication of which site it is for eg.

C:\Windows\system32>%windir%\system32\inetsrv\appcmd.exe list wp
WP "11632" (applicationPool:4a8cbf60637942ff9a2486d0e682ac54)
WP "16800" (applicationPool:SharePoint Central Administration v4)
WP "23648" (applicationPool:teams)

Now you can attach you Visual Studio debugger to the right process easily. For example for the SP site teams I will attach to PID 23648

Rohan
  • 578
  • 8
  • 12