ASP.NET/IIS: Tell IIS do not check for file existence
- by AgileMeansDoAsLittleAsPossible
In my Global.asax.cs, I have:
routes.MapRoute("AssetCss", "css/{*path}",
new { controller = "Asset", action = "Index" });
I also have this in a view:
<link href="/css/Root/index.css" rel="stylesheet" type="text/css" />
The problem is that the AssetController does not invoke Index when /css/Root/index.css is requested. This is because a file actually exists at the path /css/Root/index.css.
If I recall correctly, there's a checkbox setting in IIS that basically says "Do not check that a file actually exists at the request path [instead, let the RouteTable handle it]." (At least there is in IIS 6.)
Is there something I can put in my Web.config that sets this IIS setting to true? How do I tell IIS to let my MVC routes handle the path even if a file exists at the path?