0
votes

We're working on making SharePoint responsive. Part of the deal is to have responsive images. I would very much like to start with an IHttpHandler ala https://github.com/davemcdermid/AdaptiveImages and customize for SharePoint.

What I've done: put this adaptive images code in a project and deploy it. Dll is confirmed in the gac.

Register the handler in the web.config. When that definitely wasn't working, I registered it in IIS. It is serving images but not allowing me to debug/step through at all. When I run debugger with VS2010, the error I get says "This breakpoint will not currently be hit. No symbols have been loaded."

I've tried attaching my debugger to alternate w3wp.exe processes.

Code is verbatim from the git referenced above. Breakpoint is right inside the ProcessRequest() method. Please let me know if further details will help. Any general thoughts on how I can get step into a httphandler with sharepoint in debugger?

2
Please include the relevant part of the code here. You'll hve a better chance to get good answers to your questions quickly if all necessary details are in the question and potential answerers need not follow external links. - Daniel Fischer

2 Answers

0
votes

Try deploying your solution first from visual studio then immediately running it in debug mode. I have had tons of problems with breakpoints not loading in SharePoint and this helps.

Another solution is to download and install WSP Builder. When you right click on your project inside VS, there will be a menu option to forcefully put the assembly into the GAC. This also helps load breakpoints. There is also an option to attach a process to w3p which helps with debugging too.

Good luck!

0
votes

Sadly, my first StackOverflow question was one I ended up answering for myself. My handlers were not well registered. Doing it in IIS was actually problematic. My ultimate web.config registration ended up being:

<add name="AdaptiveImageHandlerGif" path="*.gif" verb="GET" type="AdaptiveImageHandler.AdaptiveImageHandler, AdaptiveImageHandler, Version=1.0.0.0, Culture=neutral,PublicKeyToken=2d12e1909d50e054"  />

But thank you Meyer Denney for leading my brain down a different path. I needed a fresh perspective and after research wsp builder i decided to check one last time that my handlers were solid. And they weren't.