Making ASP.Net MVC ignore folders

Here's a small tip that might be useful to anyone playing with the ASP.Net MVC previews.

As you can see from the sample sitting there, Generic Error is an MVC application.  I am using Blogger to publish this content into a sub-folder called Blog but by default MVC takes over resulting in the following error when I try to view the blog:

The controller for path '/GenericError/Blog' could not be found or it does not implement the IController interface.
Parameter name: controllerType

To solve this you first need to convert the sub-folder to an application in IIS as shown below.  I am using IIS7 however the process for IIS6 is similar:

IIS

Then add a simple web.config file to the sub folder which removes the URL rewriting module from the chain:

 File Location 

Web-Config

And that is why you can read this post.

Labels: , ,

10/04/2008 04:57 AM (UTC -07:00)