views:

457

answers:

2

I have an HTTP Handler that is the entry point for 90% of our app. Basically it gets a request, process a lot of data and returns a very specific file depending on the client & web page it is embedded on, etc. I have setup the Application Mappings so that all .kab extensions point to *C:\Windows...\aspnet_isapi.dll*. I added my HttpHandler DLL to the BIN directory for my website. When I try to browse to the test page the iFrame displays a 404. Did I miss something in my setup of the HttpHandler?

As far as debugging my code, I’ve tried attaching but I keep getting a 404 error on the page and it never steps into my code. What is the best practice method for tying into the project in debug mode?


Basic setup for test (all local on one machine):

  • IIS 5.1 on Windows XP Pro – running a plain Jane default.aspx:

<body>
<form id="form1" runat="server">
<iframe style="border-width: 2px; z-index: 100; overflow: hidden; width: 500px; height: 423px;" src="http://localhost/barrows.kab?client=33ee472yaaM24a">
</form>
</body>

  • VS2005 running in attached mode to the INETINFO.EXE Process.
+1  A: 

You also need to map .cab extension to your handler class in the web.config file.

See here.

e.g.

<httpHandlers>
 <add verb="*" path="*.cab"
   type="My.Assembly,My.Assembly.Handler, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=whatever" 
   validate="false"/>
....
Richard
Ah - right. Added the httpHandlers section and now I do not get a 404 error. However, I cannot step into code to debug. I copied my compiled DLL to the website BIN directory and in VS2005 Attached to the inetinfo.exe process, set a breakpoint in my ProcessRequest(HttpContext context) method and it does not break - at all. Suggestions?
Keith Barrows
Attach to the worker process: aspnet_wp.exe.
John Saunders
Keith Barrows
I've normally done all this in a ASP.NET project, where starting the project under the debugger takes care of the details. VS gives various start up options, including launching a specific page or program.
Richard
+1  A: 

Go back to Application Mappings and make sure the checkbox for "Verify File Exists" is un-checked. This will make anything with .kab be handled by .NET.

Relster