Root Folder and Controller with the same name

Aug 14, 2013 at 2:21 PM
Edited Aug 14, 2013 at 2:48 PM
Hello guys,

Im using MVCCoderouting and its working just fine.

I ran into an issue that I hope somebody can help me.

I have one Project names "MyWebProject" using Asp.Net MVC 4. I have one folder called Folder1 at the very first level (same level as controller folders). I also have a controller called Folder1.

When I browse to folder1, I got 403 (forbidden) because mvc is looking at the "root folder" instead of routing to the controller.

Project Structure (reduced)
- MyWebProject
   - Controllers
       - Folder1
   - Folder1
   - Views
      - Folder1
How can I ignore root folders and Always use routing based lookup ?

This post has exact the same issue (but I cant delete the root folder - it is a folder from NServiceBus and I cant get rid of it)


Aug 14, 2013 at 2:56 PM
I found an answer for this issue:

By setting routes.RouteExistingFiles = true; will force MVC to route even existing files/folders :)


Marked as answer by maxtoroq on 10/15/2013 at 9:17 AM
May 7, 2014 at 9:54 AM
What should I do so that I can access the files withing the Folders aswell.

For example access this file :