RSS Feed

ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd

May 17, 2012 by admin

After ASP.NET 4 has been enabled on IIS 6, ASP.NET 2.0 applications that run on IIS 6 (in either Windows Server 2003 or Windows Server 2003 R2) might generate errors such as the following:

System.Web.HttpException: Path ‘/[yourApplicationRoot]/eurl.axd/[Value]‘ was not found.

This error occurs because when ASP.NET detects that a Web site is configured to use ASP.NET 4, a native component of ASP.NET 4 passes an extensionless URL to the managed portion of ASP.NET for further processing. However, if virtual directories that are below an ASP.NET 4 Web site are configured to use ASP.NET 2.0, processing the extensionless URL in this way results in a modified URL that contains the string “eurl.axd”. This modified URL is then sent to the ASP.NET 2.0 application. ASP.NET 2.0 cannot recognize the “eurl.axd” format. Therefore, ASP.NET 2.0 tries to find a file named eurl.axd and execute it. Because no such file exists, the request fails with an HttpException exception.

You can work around this issue using one of the following options.

Option 1
If ASP.NET 4 is not required in order to run the Web site, remap the site to use ASP.NET 2.0 instead.

Option 2
If ASP.NET 4 is required in order to run the Web site, move any child ASP.NET 2.0 virtual directories to a different Web site that is mapped to ASP.NET 2.0.

Option 3
If it is not practical to remap the Web site to ASP.NET 2.0 or to change the location of a virtual directory, explicitly disable extensionless URL processing in ASP.NET 4. Use the following procedure:

1.In the Windows registry, open the following node:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0

1.Create a new DWORD value named EnableExtensionlessUrls.
2.Set EnableExtensionlessUrls to 0. This disables extensionless URL behavior.
3.Save the registry value and close the registry editor.
4.Run the iisreset command-line tool, which causes IIS to read the new registry value.
Note Setting EnableExtensionlessUrls to 1 enables extensionless URL behavior. This is the default setting if no value is specified.


No Comments

No comments yet.

Sorry, the comment form is closed at this time.