I built a HTTP Module, insert the DLL into the GAC, changed the webConfig Now , if on visual studio , I Attach to process W3WP , Open the web page where the module must work, I notice that breakpoints has warning and they don't hit! There are more than one w3wp.exe process. Which one should I Catch? I don't if I'm attaching to the wrong process.
Usually you can discover which one to attach to by the user name. It is usually the same as the application pool identity you're running your SharePoint Web Application with.
It's no problem to attach to all, but for god sakes, do not attach to processes on a production environment, because hitting breakpoint, pauses sharepoint processes.
It is also important to at least recycle the application pool after adding the DLL to Gac.
To find more information about the w3wp processes to figure out which one to attach to, you can use this command (I have it saved to a batch file).
%windir%\system32\inetsrv\appcmd.exe list wp
I've got one for SecurityTokenService, one with a GUID-ish name that is the search service, and one called "Sharepoint - Port#" for each web app.
The rule of thumb for me was always to pick the worker process with the highest number as ID.