Httphandler not working in visual studio web server?

I

Ilyas

Hi all

I have a simple httphandler :

public class TextFileHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Text file handler");
}

public bool IsReusable
{
get
{
return false;
}
}
}
}

and in my web,config I have registered this handler using the
following:

<add name="TextFileHandlerName" verb="*" path="*.txt"
type="TestHttpHandlers.Usage.TextFileHandler" />

Now when I browse to any text file, I am expecting my handler to kick
on and intercept the request.

It doesnt happen when I run it under the built in Visual studio
asp.net development server, but it works under IIS7 (the above code
gets executed)

Does anyone know ehy it doesnt work the built in the visual studio
built in web server?
 
M

Mark Fitzpatrick

The built in web server has limitations. It's an outgrowth of the Cassini
web server which was made as a free mini-server so that Windows XP Home
users could develop for ASP.Net since the Home edition didn't come with IIS.
If you have IIS available locally, use that instead as it provides
real-world testing since the VS test server is not based on a production web
server.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
 
S

sloan

I wish MS would make IIS the default, and the "new-cassini" the backup plan
if you don't have IIS.

Our jr developers seem to hit snags when deploying their application.
Security with cassini vs IIS seems to be the biggest blunder.

My motto is "If you can't deploy your code, your code is worthless". I'm
not always the popular guy at work.

...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top