问题
I have a ashx file in a non web project in VS2008. The type of web project (stsdev that is used with Share Point) deploys the ashx file to the server. I can navigate to the file and it is there. In VS2008 when I try and put a break point in the ashx code it will not let me. This means when I connect to the WP3.exe process to remotely debug it nothing will be fired. What steps can I take to get this to debug?
回答1:
The link here covers it well:
http://www.myrocode.com/post/2009/06/03/Custom-HttpHandler-in-SharePoint-2007-using-code-behind-and-debug-option.aspx
In short
- Add {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} to .prodj file
- Create Generic Handler
- Add reference to assembly in markup reference e.g: <%@ Assembly Name="SharePointHttpHandlers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=23d6ec32decbea39" %>. You can get this by using Reflector.
This allowed me to debug at runtime.
来源:https://stackoverflow.com/questions/1334538/visual-studio-ashx-files-debugging