Had the same issue trying to debug a DNN (Dot Net Nuke) module. Turned out you need to have compilation debug="true":
<compilation debug="true" strict="false" targetFramework="4.0">
in your web.config. By default it is false in DNN. Original source here: http://www.dnnsoftware.com/forums/forumid/111/postid/189880/scope/posts