404 when page exists - IIS 5, ASP.NET 4.0

I have a webserver running Server 2003 Datacenter and IIS 5 which is hosting a variety of ASP.NET 2.0 websites. I'm attempting to add an ASP.NET 4.0 website which I wrote via the VS2010 Beta, and I have .NET 4.0 Beta 1 installed on the server.

The website appears to be configured correctly; anonymous access is on, it points to the right folder, and is set to asp.net 4.0.

Why might it be giving me a 404 error when I browse to it, both locally and remotely?

-
Wow, 4 hours later and this thread is #1 on Google for "asp.net 4.0" 404 -- W2G on SEO, Jeff! – tsilb Jun 22 '09 at 4:21
Im amazed at how quick google picks up on serverfault. I posted a question, deleted it 5 minutes later, but Google still had it 24 hours later as the #1 query for my search term! All because it was up for 5 minutes. – Mark Henderson Jun 22 '09 at 4:33

Is logging turned on? If it isn't, turn it on. If it is on, check to see of a corresponding entry is written to the log file, and check to see if all its details match up.

If no entry is being written, then it's possible that the wrong website in IIS is serving the content for your request (check the hostname it's listening on).

Lastly, are you sure it's IIS 5? I thought 2003 shipped with IIS 6?

-
Yep; logs reflect the 404. 2009-06-22 00:09:40 192.168.0.51 GET /Default.aspx - 82 - 192.168.0.111 Mozilla/4.0+ (compatible;+MSIE+8.0;+Windows+NT+6.1; +WOW64;+Trident/4.0;+SLCC2; +.NET+CLR+2.0.50727; +.NET+CLR+3.5.30729; +.NET+CLR+3.0.30729; +Media+Center+PC+6.0; +InfoPath.2; +.NET+CLR+4.0.20506) 404 2 0 – tsilb Jun 22 '09 at 3:40
Ok, well that tells us that the correct IIS site is serving the request, which is always a great start ;) IIS has a few characteristics that I can see that might cause this. I'm assuming that ASP.NET 4 is enabled in the Web Extensions? If so, then it might not be serving the content because there's no associated MIME type for ASPX (unlikely), or because the mapping for ASPX is not pointing to the runtime... – Mark Henderson Jun 22 '09 at 4:32
oh, DUH! Why would that be prohibited by default? Thanks! – tsilb Jun 22 '09 at 5:15
Yeah, I've run into that issue myself more than once with ASP.NET. In Windows 2008/IIS7 it isn't even installed by default. All attempts at increased security I guess! – Mark Henderson Jun 22 '09 at 5:26

404 Substatus 2 in IIS means: "Web service extension lockdown policy prevents this request.", the more friendly message on IIS7 for 404.2 says "The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the web server."

Check out the follow KB articles for possible fixes:

In IIS6 and 7 the http sub-statuses contain important information, for a full list check:

IIS5 and 6 : support.microsoft.com/kb/318380

-
I so agree, often the error message is exactly right, like 404 in IIS 5 if I recall correctly says "Resource not found" that could mean the aspx/html physical file was not found, but it could also mean that the script map is pointing to a invalid file or because of security some part of your system could not locate that spesific "resouce" – Rihan Meij Jun 22 '09 at 6:00

You just need to enable the web extension for ASP.NET 4.0 in IIS.

-

Is the DNS name pointing to the right server?

-
Yep, happens when I browse to localhost or to the server by name. – tsilb Jun 22 '09 at 3:37

Check the metabase.xml file ... is there a '1' at the start of the line for Framework\V4.0.21006 in WebSvcExtRestrictionList?

I had the same problem and setting it to '1' (enabled) cured the problem. ASP.NET 4.0 Beta 1 did not have this problem. The problem only appeared on install of ASP.NET 4.0 Beta 2.

Here's what it looked like BEFORE fixing the problem:

	WebSvcExtRestrictionList="0,C:\SERVER\system32\inetsrv\httpodbc.dll,0,HTTPODBC,Internet Data Connector
0,C:\Perl\bin\perlis.dll,1,,Perl ISAPI Extension
0,C:\SERVER\system32\inetsrv\httpext.dll,0,WEBDAV,WebDAV
0,C:\Perl\bin\PerlEx30.dll,1,,PerlEx ISAPI Extension
0,C:\Perl\bin\perl.exe &quot;%s&quot; %s,1,,Perl CGI Extension
1,C:\SERVER\system32\inetsrv\asp.dll,0,ASP,Active Server Pages
1,C:\SERVER\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,0,ASP.NET v2.0.50727,ASP.NET v2.0.50727
0,*.exe
0,*.dll
0,C:\SERVER\system32\inetsrv\ssinc.dll,0,SSINC,Server Side Includes
0,C:\SERVER\Microsoft.NET\Framework\v4.0.21006\aspnet_isapi.dll,0,ASP.NET v4.0.21006,ASP.NET v4.0.21006"

-