Root Folder and Controller with the same name

Imported from the CodePlex archive for reference purposes. Support for MvcCodeRouting has ended.

Commented on
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
           Folder1Controller.cs
   - Folder1
   - Views
      - Folder1
         Index.cshtml
  
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)
http://www.west-wind.com/weblog/posts/2012/Apr/05/Physical-Directories-vs-MVC-View-Paths


Regards

Bruno
Commented on link
I found an answer for this issue:

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

Thanks

Bruno
Commented on link
What should I do so that I can access the files withing the Folders aswell.

For example access this file : somewebsite.com/Folder1/hello.txt