|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 834270 - Last Review: April 7, 2006 - Revision: 2.2 FIX: You receive an "HTTP 404 Error" error message and the custom HTTP handler does not run again after you map Aspnet_asapi.dll to .*Notice
For a Microsoft .NET Framework 1.0 version of this article, see 829930Â
(http://kbalertz.com/Feedback.aspx?kbNumber=829930/
)
.
You can configure an HTTP handler to handle all file name extensions that have no mappings. If the handler is configured this way, and you visit a Web site in a virtual directory that contains an application that has no mappings for a specific file name extension, the handler can write a response or redirect your browser as necessary.
However, if you visit a Web site in a virtual directory that contains an application that has no mappings for a specific file name extension, you may receive an "HTTP 404 Error" error message instead. This problem may occur if you visit a URL for a default file that is located in a subfolder that does not exist in the virtual directory that is mapped to the handler. The first time that your browser requests the URL, the handler responds as expected. If you try to visit a specific .aspx page in the same non-existent folder, you receive an "HTTP 404 Error" error message. This is also the expected behavior.
However, if you try to request the original URL that the handler responded to, regardless of whether you reload the page, you receive an "HTTP 404 Error" error message for that request instead of the response from the handler that you received on the first visit. The handler will not run again until Microsoft ASP.NET is recycled. Important This software update contains two types of packages: a Microsoft Windows Installer (.msi) package, and an Optional Component Manager (OCM) package. If you use Microsoft Windows Server 2003, you must specify that you require the Windows Server 2003 (OCM) update because Windows Server 2003 File Protection monitors the Microsoft .NET Framework 1.1 files. If you use an operating system that is different from Windows Server 2003, you must continue to use the Windows Installer package. Software update informationA supported software update is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This software update may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next .NET Framework 1.1 service pack that contains this software update. To resolve this problem immediately, contact Microsoft Product Support Services to obtain the software update. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site: Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. PrerequisitesNo prerequisites are required. Restart requirementYou may have to restart your computer if any services or applications that use files that appear in the "File information" section of this article are running when you apply this software update. Software update replacement informationThis software update does not replace any other software updates. File information
The English version of this software update has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Date Time Version Size File name
---------------------------------------------------------------------------------------------
30-Jan-2004 04:16 1.1.4322.995 258,048 Aspnet_isapi.dll
30-Jan-2004 04:16 1.1.4322.995 20,480 Aspnet_regiis.exe
30-Jan-2004 04:16 1.1.4322.995 32,768 Aspnet_state.exe
30-Jan-2004 04:16 1.1.4322.995 32,768 Aspnet_wp.exe
16-May-2003 00:49 33,522 Installpersistsqlstate.sql
16-May-2003 00:49 34,150 Installsqlstate.sql
30-Jan-2004 04:06 1.1.4322.995 94,208 Perfcounter.dll
30-Jan-2004 04:11 8,571 Smartnav.js
30-Jan-2004 17:14 1.1.4322.995 1,220,608 System.dll
30-Jan-2004 17:14 1.1.4322.995 241,664 System.messaging.dll
30-Jan-2004 17:15 1.1.4322.995 323,584 System.runtime.remoting.dll
30-Jan-2004 17:14 1.1.4322.995 131,072 System.runtime.serialization.formatters.soap.dll
30-Jan-2004 17:15 1.1.4322.995 1,257,472 System.web.dll
30-Jan-2004 17:14 1.1.4322.995 819,200 System.web.mobile.dll
30-Jan-2004 17:14 1.1.4322.995 569,344 System.web.services.dll
30-Jan-2004 17:14 1.1.4322.995 1,339,392 System.xml.dll
30-Jan-2004 04:11 14,482 Webuivalidation.js Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.
For additional information about the terminology that is used to describe Microsoft product updates, click the following article number to view the article in the Microsoft Knowledge Base:
824684Â
(http://kbalertz.com/Feedback.aspx?kbNumber=824684/
)
Description of the standard terminology that is used to describe Microsoft software updates
Steps to reproduce the behavior- Create an HTTP handler. To do this, create a file that is named
HandlerError.cs by using the source code that appears at the end of
this section.
For more information about how to create an HTTP handler,
see the "References" section of this article. - Create a new Visual C# library project, and then add the file that
you created in step 1 to this project.
- Create a new C# ASP.NET Web Form application that is named test.
Note You can make both this project and the project that you created in
step 2 part of the same solution. - Add the handler that you created in step 1 to the Web.config file that was created as a part of the Web Form application that you created in step 3. To do this, add the following code to the Web.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*" type="test.HandlerError,test" />
</httpHandlers>
.
.
.
<system.web> - Use Microsoft Internet Information Services (IIS) Configuration Manager to map all the unknown file name extensions for the Web Form application that you created in step 3 to the Aspnet_isapi.dll file. To do this, follow these steps:
- At a command prompt, type inetmgr.exe, and then press ENTER to open IIS Configuration Manager.
- Locate and then click the application that you created in step 3.
- Right-click the application, and then click Properties.
- In the Properties dialog box, click the Virtual Directory tab.
- On the Virtual Directory tab, click Configuration.
- In the Configuration dialog box, click the Mappings tab.
- On the Mappings tab, click Add.
- In the Executable box, type the path of the Aspnet_isapi.dll file. For example, type the following:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll - In the Extension box, type the following, depending on your operating system:
- If your computer runs Microsoft Windows XP, type the following:
.* - If your computer runs Microsoft Windows 2000, type the following:
*
- Click to clear the Check that file exists check box.
- In all open dialog boxes, click OK until you return to the main IIS Configuration Manager window, and then quit IIS Configuration Manager.
- In your browser, open a default file in a subfolder that does not exist under the virtual directory that was created as a part of the Web Form application that you created in step 3. For example, type the following in the address bar and then press ENTER:
http://localhost/test/folder You receive the following response from the handler:
Handler Entered: - In your browser, open the following file:
http://localhost/test/folder/file.aspx You receive an "HTTP 404 Error" error message. - In your browser, open the following file again, and then reload the page:
http://localhost/test/folder You receive an "HTTP 404 Error" error message instead of the response from the handler that you received in step 6.
Code for HandlerError.cs using System;
using System.Web;
namespace test
{
public class HandlerError: IHttpHandler
{
bool IHttpHandler.IsReusable
{
get {return false;}
}
public HandlerError()
{
//
// TODO: Add constructor logic here.
//
}
void IHttpHandler.ProcessRequest(HttpContext context)
{
context.Response.Write("Handler Entered:");
}
}
}
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
307985Â
(http://kbalertz.com/Feedback.aspx?kbNumber=307985/
)
INFO: ASP.NET HTTP modules and HTTP handlers overview
308001Â
(http://kbalertz.com/Feedback.aspx?kbNumber=308001/
)
HOW TO: Create an ASP.NET HTTP handler by using Visual C# .NET
307997Â
(http://kbalertz.com/Feedback.aspx?kbNumber=307997/
)
HOW TO: Create an ASP.NET HTTP handler by using Visual Basic .NET
APPLIES TO- Microsoft .NET Framework 1.1
- Microsoft ASP.NET 1.1
- Microsoft Visual Studio .NET 2003 Professional Edition
- Microsoft Visual Studio .NET 2003 Enterprise Developer
- Microsoft Visual Studio .NET 2003 Enterprise Architect
| kbqfe kbhotfixserver kbnetframe110presp1fix kbfix kbcode kbbug KB834270 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |