I faced a weired problem on my dev machine today, where I was not able to debug on the SharePoint page with VisualStudio 2010. I replaced the dll in the GAC , upgraded the wsp with the latest code but still was unable to attach the code with the SharePoint page.
Then I read an article http://evan-p.blogspot.com/2010/12/visual-studio-2010-debugger-not.html where I came to know the problem is because of Visual Studio and the .Net FrameWork used.
When attaching the debugger, Visual studio by default automatically determines the code types to debug . With Visual Studio 2010 however, there’s now 2 Managed code types (v2.0, v1.1, v1.0) and (v4.0) [Check the screenshot above], as we are still using .NET 3.5 occasionally Visual Studio gets confused and automatically determines 2.0 managed code as 4.0 managed code. This causes the debugger to be successfully attached but not to stop in any breakpoints.
Hence if the debugger code is getting attached successfully and you are sure that the DLL and code is the latest in GAC or bin, then definietly check for the Attached to box as shown in the screenshot and make sure it is getting attached to the right managed path.
Thanks Evan for pointing this out to me......... :)