Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:39:04+00:00 2026-06-08T03:39:04+00:00

I find it ridiculous that MVC doesn’t recognize a controller unless it has ‘Controller’

  • 0

I find it ridiculous that MVC doesn’t recognize a controller unless it has ‘Controller’ appended to the class name. This answer mentions the ControllerDescriptor and ControllerTypeCache as the two places in MVC where this convention is set up.

My question is why? It’s clearly not a convention over configuration thing, as IsControllerType in ControllerTypeCache checks that the class:

  • Is public
  • Is not abstract
  • Implementes IController
  • Ends with "Controller"

Does anybody know the reason for this? After all controllers are likely to be in an actual MVC project, in a folder named ‘Controllers’, and a simple double click on the file will show us that the class inherits Controller.

Just seems silly to me – but I was wondering if there is an actual reason they have done this.

EDIT

Just seen this blog post by Phil Haack from yesterday where he discusses the decision this convention – he is of the same mind of me – Probably a bit pointless!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:39:08+00:00Added an answer on June 8, 2026 at 3:39 am

    Custom controller factory

    You can always provide a custom controller factory that will resolve these classes differently. And I do agree that controllers need no Controller type name appending because after all they’re just like any other class. Their OOP ancestor type defines them as controllers anyway (IController, Controller…)

    Visual Studio maybe?

    Although it may have something to do with Visual Studio. Similar to Attribute classes. Maybe Visual Studio wouldn’t provide additional context menu items to classes that don’t end with Controller. When being in controller action you can easily navigate (or create) to the matching view.

    Conventions are good

    So say the experts and I do agree. There are other conventions like these in .net framework as well but people don’t complain about them.

    Think of collections, dictionaries, attributes, lists and other types that also use similar suffixes without particular reason. They’d work either way, but they’re much easier recognisable by their users – developers – who instinctively know how they should work and when to use them.

    Type clashes as per Asp.net MVC team

    Imagine having a ProductController that likely handles Product application model entity instances. By not having the controller naming convention, we’d have two types with the same name hence would always have to provide namespaces to distinguish between the two. But because we do have this convention this is not necessary and no type clashes occur.

    public class ProductController : Controller
    {
        public ActionResult Index()
        {
            // we'd have to distinguish this Product type here
            IEnumerable<Product> result = GetProducts();
            return View(result);
        }
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is so simple that it's ridiculous I couldn't find any information about this
I have a file that has over 200 lines in this format: name old_id
In this hypothetical example, imagine I have an object FooSet that has five properties
I have a project that has a ridiculous amount of customization required. As such,
I have to find an element by its id with jQuery. This element has
I know title is really ridiculous. I couldn't find how I can describe this.
i find a lot of questions about this problem but i did not solve...
I find the following example mildly surprising: >>> class Foo: def blah(self): pass >>>
I find that, Windows 8 will be highly HTML5 + Javascript based Metro Application
I find that I'm repeating myself alot and that is of course no good.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.