473,795 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Httphandler not working in visual studio web server?

Hi all

I have a simple httphandler :

public class TextFileHandler : IHttpHandler
{
public void ProcessRequest( HttpContext context)
{
context.Respons e.ContentType = "text/plain";
context.Respons e.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="TextFileH andlerName" verb="*" path="*.txt"
type="TestHttpH andlers.Usage.T extFileHandler" />

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?
Jul 23 '08 #1
2 4449
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

"Ilyas" <il***@igsoftwa resolutions.co. ukwrote in message
news:c8******** *************** ***********@e53 g2000hsa.google groups.com...
Hi all

I have a simple httphandler :

public class TextFileHandler : IHttpHandler
{
public void ProcessRequest( HttpContext context)
{
context.Respons e.ContentType = "text/plain";
context.Respons e.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="TextFileH andlerName" verb="*" path="*.txt"
type="TestHttpH andlers.Usage.T extFileHandler" />

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?
Jul 23 '08 #2

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.

...

"Mark Fitzpatrick" <ma******@fitzm e.comwrote in message
news:Oo******** ******@TK2MSFTN GP02.phx.gbl...
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

"Ilyas" <il***@igsoftwa resolutions.co. ukwrote in message
news:c8******** *************** ***********@e53 g2000hsa.google groups.com...
>Hi all

I have a simple httphandler :

public class TextFileHandler : IHttpHandler
{
public void ProcessRequest( HttpContext context)
{
context.Respons e.ContentType = "text/plain";
context.Respons e.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="TextFileH andlerName" verb="*" path="*.txt"
type="TestHttp Handlers.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?

Jul 23 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1559
by: Bruce B | last post by:
Hi group, I'm experiencing some extreme weirdness over the last week with IIS related to it's Mappings and how .NET is behaving. I can't explain the behavior as it seems very random. Our app has about 50 file extensions that we map in IIS and handle in our HTTPHandler to catch the reference and then lookup the correct content from a database. In addition, we do some magic in a HTTPModule to rewrite paths for file types we don't...
5
2867
by: Earl Teigrob | last post by:
My company sells software and wants to provide downloadable product. Some of these downloads will be full CD's of over 550M I had everything working fine using Response.filewrite() but when we tested it with large files, it blew up. (crashed the server, well documented problem) I can download a file just fine if I just point to the download file and let IIS generate the download dialog (but with no security, of course)
3
3092
by: Hitesh | last post by:
Hi, I am getting the response from another Website by using the HttpHandler in my current site. I am getting the page but all the images on that page are not appearing only placeholder are displayed. Can anybody know this issue and help me to resolve this. In past i received the response saying that i should download the image first and then parse the actual response and modify the src attribute of the
1
2336
by: sathya | last post by:
hi, i have problem in httphandler, my problem is that when i am trying to use server.execute(/default.aspx) i am getting error.... Here i am trying to redirect from home.aspx to default.aspx (both file isin sharepoint).I have give a copy of my code below..
0
1085
by: Manikkoth | last post by:
Hello, We are using a user control and a HttpHandler to display an image in a grid. The images are stored in a RDBMS. Here is the approach that we use in brief. The cells are added to the grid in the page load. One of the cell is the control. The control Response.Writes an img tag. The src for the img tag is "something.img". Now we have a HttpHandler for *.img, the hander reads the image from DB and does a Response.BinaryWrite. Everything...
0
1001
by: Manikkoth | last post by:
Hello, We are using a user control and a HttpHandler to display an image in a grid. The images are stored in a RDBMS. Here is the approach that we use in brief. The cells are added to the grid in the page load. One of the cell is the control. The control Response.Writes an img tag. The src for the img tag is "something.img". Now we have a HttpHandler for *.img, the hander reads the image from DB and does a Response.BinaryWrite. Everything...
7
2923
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*" path="*.sgf" type="CustomExtensionHandler, Extenders.CustomExtensionHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d831d925597c1031" validate="True"/> </httpHandlers>
8
3902
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the Transfer method, but everything gets me the same error 500. Any help would be appreciated.
7
4048
by: vamichael | last post by:
When I try to run the Website Administration Tool from my published application using http://localhost/myapp/webadmin.axd I am getting a "resource not found" error message. I can use the Admin tool from the IDE however. I noticed some people referring to a directory called c:\Inetpub\wwwroot\aspnet_webadmin\, which i do not have on my system.
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.