views:

955

answers:

6

I installed .net framework 4 on my windows 2003 enterprise x64, wrote simple asp.net 4.0 application (default.aspx page only). The application works great if request is to default.aspx, not to the root site:

contoso.com/ - doesn't work (Get 404 error)

contoso.com/default.aspx - works.

Default.aspx is in list of default documents in IIS. Please help.

A: 

Are you sure it's default.aspx not default.asp in the list of default documents?

David M
absolutely. The first number in the list
Dimonina
Did you add it yourself or was it already there? Is there any chance it could be a typo?
David M
It was already there
Dimonina
+2  A: 

You will find the answer here http://johan.driessen.se/archive/2010/04/13/getting-an-asp.net-4-application-to-work-on-iis6.aspx

.Net 4.0 doesn't enable itself to run with IIS so you have to run the command (while in the folder c:\windows\system32): cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll or in your case since you are running x64

cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll

Jonatan B
.net 4.0 isapi extension is enabled. Site works fine. Still have no answer
Dimonina
Run cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll and then restart IIS
HasanGursoy
@Dimonina: Did this work.??
Amitabh
Extension is enabled, because default.aspx works
Dimonina
A: 

Having the same issue (website/default.aspx works, but website/ results in 404).

Running "cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" and then restarting IIS doesn't work.

Any further suggestions?

Will WM
+4  A: 

Found a fix in a seemingly unrelated location - try setting the "EnableExtensionlessUrls" registry key to 0:

ASP.NET 4 Breaking Changes -> ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd:

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.
Will WM
didn't work for me :-(
Dimonina
This worked for me!
Aaron Carlson
Just as a heads for for anyone who runs into this issue, we found that installing the hotfix for this issue http://stackoverflow.com/questions/3720720/how-serious-is-this-new-asp-net-security-vulnerability-and-how-can-i-workaround-i erased this reg key, which re-created this issue. Once we re-applied this fix, default documents worked correctly again
John Hann
A: 

Has anyone found an answer to this issue? I am experiencing the same problem.

nkranes
A: 

I don't have enough points to comment apparently, but I wanted to say that the solution from Will WM worked for me. Adding EnableExtensionlessUrls to the registry corrected the problem.

As a side note, if your run aspnet_regiis at anytime, it will remove this value and you will need to add it again.

Jarrod