简体   繁体   中英

IIS6 behaves weirdly when I request a URL with an extension mapped onto ASP.NET ISAPI extension

I tried to deploy an ASP.NET application in IIS6. I created a virtual directory MyApp , mapped it to a folder on the hard drive, copied all the stuff from my application to that folder.

Now when I request http://host/MyApp/ I get HTTP 403 and that request is logged in the IIS log. When I request http://host/MyApp/default.aspc (there's no such file) I get HTTP 404 and that request is also logged.

But when I request http://host/MyApp/default.aspx (that file is present in the folder which the virtual directory is mapped to) Internet Explorer just says it "cannot display the web page", that request is not logged. When I trace requests with Fiddler it shows empty reply and HTTP code 0 on the client side. .aspx extension is of course mapped onto ASP.NET ISAPI extension.

ASP.NET 2.0 is installed into IIS. When I run aspnet_regiis -lk it produces the following output:

W3SVC/  2.0.50727.0
W3SVC/1/ROOT/   2.0.50727.0
W3SVC/2/Root/   2.0.50727.0 

What's wrong? Why does IIS6 behave so strangely when I request files mapped to ASP.NET ISAPI and how do I resolve this?

This particular oddity is normally caused by ASP.NET not being enabled under "Web Service Extensions"

Steps:

  1. Control Panel > Administrative Tools > IIS Manager
  2. Expand the machine node in the tree
  3. Click on "Web Service Extensions"
  4. Right-click on the appropriate ASP.NET version in the list to the right and choose "Allow"

Hopefully this is the issue you're having!

I apologise if these seem like obvious questions:

Have you checked to make sure that the ASP.NET extensions really are mapped to the ASP.NET ISAPI extension in the virtual directory itself:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Is the correct version of ASP.NET installed, if at all?

Also, is this folder a virtual directory (icon has a folder with a globe) or is it an application (icon is a gear).

If it's Virtual Directory then you need to make sure your /bin folder and web.config are in the site root.

Although Google searches show that the typical reason is ASP.NET being misconfigured in my specific case the reason was Windows Sharepoint Services 3, installed onto the same machine. Once it has been installed, ASP.NET applications seem to no longer work. Reinstalling .NET and IIS doesn't help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM