2

I want to debug a ASP.NET application (Custom IHttpHandler) with Visual Studio 2008 and IIS7.

I compile the source, start debugging (F5) and IE loads. But my breakpoint (in method ProcessRequest()) is disabled. I get the error:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

I have no idea about ASP.NET programming. Do i have to set anything in IIS?

The PDB files are there. I wanted to check the symbol load status of my DLL but I couldn't find it.

When I open "Debug->Windows->Modules" I can't see my DLL in the list.
Only Windows DLLs and assemlies from GAC and so on.

Am I missing something?

juergen d
  • 201,996
  • 37
  • 293
  • 362
  • Are you running as Administrator? You'll need admin permissions to attach to the IIS processes. – Rup Jun 14 '11 at 14:35
  • @Rup: yes i run VS2008 in admin mode. – juergen d Jun 14 '11 at 14:43
  • got it. i had to open a page with an specific file ending while debugging. as soon as i opened the right page my ddl loaded and the breakpoint activated. well, i do really know nothing about asp programming... thanks for the quick anwers anyway. – juergen d Jun 14 '11 at 15:09

5 Answers5

3

Visual Studio -> Debug -> Attach to process

w3wp.exe

More info here: http://www.codeproject.com/KB/aspnet/ProcessAttache.aspx

Denis Biondic
  • 7,943
  • 5
  • 48
  • 79
  • there is no w3wp.exe. i don't want to debug an app that is hosted on an iis. the Visual Studio project is configured to start the VS Dev Server to host the app. – juergen d Jun 14 '11 at 14:41
  • 1
    wait, you said Visual Studio 2008 and IIS7, if there is site hosted in IIS there would be w3wp.exe. Sorry if I misunderstood you – Denis Biondic Jun 14 '11 at 14:44
3

For the archive: a breakpoint is only activated, once the corresponding assembly was loaded in the process space. So in order to enable a breakpoint which was set on a code line inside a DLL, you must run your app to the place, where the DLL is loaded. The breakpoint will than get recognized by the debugger and ungrayed in VS.

Paul Wendler
  • 325
  • 3
  • 9
2

The problem for me turned out to be that the Properties->Build->Optimize code checkbox had been turned on in the Debug configuration. Turned it off, rebuilt, and debugging worked as normal.

Samuel Jack
  • 32,712
  • 16
  • 118
  • 155
1

Have you registered the HttpHandler in the <system.web> section instead of <system.webServer>?

In web.config:

<system.web>
    ...
    <httpHandlers>
        <add verb="GET" path="MyHandler.ashx" type="MyHandler, MyAssembly" />
    ...
    </httpHandlers>
</system.web>

See Also

Community
  • 1
  • 1
mika
  • 6,812
  • 4
  • 35
  • 38
1

Solved it.

I had to open a page with an specific file ending while debugging. As soon as I opened the right page my DDL loaded and the breakpoint activated.

juergen d
  • 201,996
  • 37
  • 293
  • 362