What file extensions must be allowed in request filtering when using ASP.Net MVC 3

asp.net-mvciis-7.5request-filtering

I have request filtering enabled and "Allow unlisted file name extensions" is set to false. When requesting any normal path, including "http://localhost" I get a 404.7 error – "The request filtering module is configured to deny the file extension."

If I set "Allow unlisted file name extensions" to true then the site works fine.

I know that "http://localhost/" maps to Views/Homes/Index.cshtml" and .cshtml is explicitly allowed.

I am trying to figure out which file extension is causing the issue but can't find anything in the logs. I have all 55 "default" file types set to allow.

Best Answer

Try just "." as the file extension. This seems to work on a Windows 2008 R2 SP1 box with ASP.NET 4.

I haven't seen this documented anywhere, but it follows the same rule as the Handler Mappings for extensionless URLs that were introduced in ASP.NET 4 / W2K8 R2 SP1 (see Meaning of path attribute on handlers in web.config question).