Asp.Net 5 MVC 6: Why AddMvc() and UseMvc()?

This is one of those things that strikes me wrong about the whole new shiny system.  It’s a bit of a shame when they redo everything from scratch and get such basic things wrong (“we got rid of web.config.  why?  To make configuration more difficult!!!”)

There is a ‘Pay As You Go’ notion that they like to talk about in their discussions.  The idea, not entirely stupid, is that you need to explicitly state how you want things to be, so to speak, so as not to end up with a bunch of framework (and other) code that you don’t need and never use.

Well and good.  Except, it is a framework.  It has its own black magic Dependency Injection system so that things ‘just work’, so why wouldn’t you be able to say UseMvc() and have it just work?

A StackOverflow post suggests a misguided (borderline incoherent) approach to Separation of Concerns.

What’s going to happen, of course, is that everyone is going to use the non-empty template and strip out the controllers and views, and leave in a whole bunch of cruft that will never be used, completely defeating the purpose.  Of course, what do you expect when you have to configure the system to serve static files?  That is just gratuitous.

posted on Friday, December 25, 2015 10:34 PM Print
No comments posted yet.

Post Comment

Title *
Name *
Comment *  
Please add 4 and 6 and type the answer here: