Should I Use ASP.NET Core or MVC 5?

6cyMkrEcnI received a question this morning in my email that I thought I would answer here so that everyone can have the benefit of my answer:

“I’m planning to build a new web application in a software as a service (SaaS) model.  Which option is better: ASP.NET MVC 5 or ASP.NET Core?”

This is an interesting question given the current releases and timetable for future releases.  It also begs the question: What do you mean by ‘better’?

Both frameworks will still be supported in at least 4 years.  Both frameworks have an MVC approach to coding and both use a very similar Razor templating language.

If you are looking 15 years out, I cannot forecast that far into the future.

If you are looking for raw performance, ASP.NET Core would be my choice.

If you are looking for something that is tested and has been running major websites for almost a decade, MVC 5 would be my choice.

If you want to be on the leading edge of technology using nightly builds and you’re comfortable with updating and upgrading your code, then ASP.NET Core would be my choice.

If you want the flexibility of developing and running your application on multiple operating systems, then ASP.NET Core would be my choice

If you want a framework with thousands of packages and an active ecosystem that has curated its packages for the past 5 years, the MVC 5 would be my choice

If you want to be able to deploy your application to containers, you can actually choose either – as the new Windows container model promises to support the full .NET framework that MVC 5 is built on

If you want to share components with other applications across a variety of form factors and operating systems including your web server, Mac, iOS, Android, XBox, Windows Phone, Windows Desktop, and the Unity framework, then you should develop with .NET Platform Standard in mind and you can choose either framework.

There is no one right answer for this question.  Its the old architect’s answer of “it depends” because there are a lot of factors in choosing either platform.  I recommend you make a checklist of the feature you want in your application framework and use the one that closest meets your needs.  I’ve used both frameworks to build applications in the past month, and I’m happy with both.

  • jbogard

    For me, there are other two big wins for Core – built-in DI through-and-through, and the merging of Web API and MVC. Not having to define two sets of configuration and setup for a web API app and MVC app is nice.

  • Matt S.

    These are great points. I haven’t kept up with Core progress on things like SMTP and image manipulation though. If you can use services for those things, it may not matter, but if you need to do those things on your server, you may need to wait for support in Core.

  • Manoj Kumar Sharma

    The main reason why one should opt for core today, would be to address the needs of the deployment environment for a web application. If one is to deploy cross-platform, then opting for core would make sense. The other reason is to remove the dependency on IIS, and leverage upon the performance and speed of the new Kestrel platform (currently available only on the .NET Core Stack).

    • Matthew Blott

      I mostly agree but I do have production sites running MVC5 on Linux currently. I documented the process on my blog here for anyone interested.

      • Running Mono in a server configuration is not recommended based on how Mono manages memory and handles workloads. It was primarily designed to support client application needs.

        • Matthew Blott

          I hadn’t heard that, interesting to know. A bit late now!

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

          • freeyoung2ad

            I had a web application implementation on mono framework on linux where the application originally developed and was successfully running on Windows server. There were serious performance issues and memory leak on mono. If we plan to develop a web application for mono framework then we should take maximum care to avoid all kind of memory leak. I found primarily the garbage collector is a mess in mono.

  • Pingback: Dew Drop - August 12, 2016 (#2308) - Morning Dew()

  • William John Adam Trindade

    Jeff, please join the antiifcampaign.com (it has many IFs nested in your text) 😛

    Very nice article. Thanks

    • Gabriel Weber

      I didn’t knew about that initative. Very cool! Thanks for sharing!

  • Pingback: The week in .NET – 8/16/2016 | .NET Blog()

  • Pingback: The week in .NET – 8/16/2016 | Techno Mega News | Dailay IT News Updates()

  • Andrey Mironov

    It should be noted that one could use ASP.NET Core and full .NET Framework 4.6.2. In this setup all we use all good new things in asp.net like middleware, DI, tag helpers, new configuration system, Kestrel server and at the same time use all current libraries build for .net framework.

  • Robert Paulsen

    As somebody that develops in both, I’d say I like the freshness of .NET Core. The command-line-first tools are great. The libraries are sometimes missing features, but are nicely trimmed of years of bloat. Unfortunately the tooling is a bit rough. I realize it’s still Preview 2, but I’m not doing preview work. VS2015 seems to suffer in performance on these projects, and IntelliSense has a heck of a time keeping up with cross-project references. Once we get to migrating our WCF components, I’m likely to be less-thrilled with the freshness and more-annoyed with the simplicity.

  • Amol Kulkarni

    Nice article! As you rightly said, it depends on the checklist that you want to use. Both are solid options yet cross-platform availability opens a new world altogether. In the long run, yes core would be ideal option. In today’s world of devops, multi-platform and freshness; core scores more brownie points. And ecosystem around it is getting built and it is just matter of time.

  • Jani ‘Jassi’ Hyytiäinen

    What do you mean both frameworks will be supported in at least 4 years? It clearly says in http://asp.net/support that “Starting with MVC 5, Web Pages 3, Web API 2 and SignalR 2 the support policy will be to support the current version and the previous version. These products are defined as “Tools” in the Microsoft Support Lifecycle Policy. A “Tool” requires a minimum of 12 months notification prior to the end of support.”.

    When it comes to Core, however, there’s a totally different game at play: https://www.microsoft.com/net/core/support

  • gunslingor

    Jeezzz!!!! God!!!!! Erg!!! This is precisely why I prefer coding in Linux with a PHP server and javascript. Microsoft has created a real monster with visual studio and ASP.Net in comparison. Unfortunately my client wants to build for a windows server using visual studio… there is so much unnecessary and gumbled crap in this platform. Terminology and paradigm shifts every year, tweaks to make visual studio act like its open source counterparts or just relying on them inherently. I can’t believe anyone would want to use this. I’ve spent the last 8 hours trying to figure out how to write a simple hello world application… I can even figure out which web based template I should be working with, ASP.net web API, MVC, web forms, blank, etc… this is rediculous… why can’t I just open a text editor and start coding. I’ve developed numerous large websites in php, and I always opt to essentially develop my own framework as I work. It’s like MS is trying to shove crap down my throat that’s a mix of 20 different meals from 10 different chefs all arguing about what to cook. God it’s just terrible… a computer engineer should be able to jump into any IDE and start coding, Visual Studio is a nightmare…. I just want to develop with notepad++ for god sake. prebuilt frameworks are horrible, ASP.net is the worst.

    • Wow, there is support for your approach in both Visual Studio and the .Net frameworks. BTW: PHP is supported in Visual Studio Code and Visual Studio.

      If you want to try ASP.Net, you can use a similar concept of middleware that you have in NodeJS to set up and respond to various end points if that is how you would prefer to code.

      If you’d rather just have pages listening at distinct end points, similar to the PHP model that you’re accustomed to, check out Asp.Net web pages where you can mix C# with razor templating for an easy to build experience.

      Millions of developers find the .Net tools and frameworks to be very productive and help them deliver sound applications. There are lots of choices available and you can always bring your own framework like NancyFx if you’d prefer.

      Best of luck to you.

      • gunslingor

        Thanks… and sincerely sorry for the rant. I was completely overwhelmed for a moment. I decided to ignore the templates and just start a blank project, from there things look more familiar and I feel more free to write my code.

        There are tons of controls and menus in VS, I’ve never had the need for all this before but maybe they will be of use. One difficulty I’m still having is finding solid documentation or tutorials on all these controls… but I’m making some progress/

        • Ffocsi

          Hi gunslingor

          I use have used Visual Studio a lot and as strange as it might sound you can ignore almost everything in it once you get it. But for a more recognisable approach you can opt to use .NET Core and Visual Studio Code.

          Visual Studio Code is actually a text editor quite akin to Sublime Text. .NET Core uses command line tools to generate and run your web page.
          https://code.visualstudio.com/
          https://www.microsoft.com/net/core#windowscmd

          You can actually create a blank dotnet core project and build it from the ground up, adding your webserver functionality etc.

          Because it is so fresh and new, all the tutorials will be up to date and useful.

          Check this for database interaction:

          Sorry I can’t offer much more I am actually just exploring dotnet core as we speak 🙂 (I’ve always used MVC and WCF in Visual Studio)

          PS You can even run VSC and .NET core in Linux so you can develop on Linux and run and test on windows server.
          https://www.microsoft.com/net/core#linuxubuntu

      • gunslingor

        Yeah, I take it back… Visual Studio is a horrible monster. 16 hours trying to create a freaking database… would have taken me 20 minutes in MySQLWorkbench. I still have nothing to show for that time. It’s so ridiculously bloated… impossible to write reliable code in this platform. Documentation conflicts with itself constantly since there are so many versions and paradigm shifts. An IDE is supposed to be intuitive and is supposed to accelerate programming… every other IDE I’ve used I hit the ground running. With visual studio, I feel like I’m wearing concrete shoes running a maze course designed by a drunkard. I should not have to take a 4 month college course to learn how to use a development environment. This is absolutely ridiculous, the concept of VS is rediculous… one IDE for every possible type of program creates so much clutter and ambiguity for doing the simplest things. I’m sorry for griping but this is getting ridiculous. All I need is a webbased froom end, a database and access to Active Directory. Every tutorial I watch either conflicts with another tutorial or just doesn’t work in my environment. I’m working with a blank webpage… I have no idea WTF a web application. I am just so pissed at Microsoft.

        • You don’t need to take lengthy courses to learn how to use the tools… I don’t know where you are looking for help, but there are lots of great tutorials available as well as free teaching videos that folks have had great success with.

          Try something like this EF6 tutorial to get started: https://msdn.microsoft.com/en-us/library/jj193542(v=vs.113).aspx

          Where are you looking for help?

          • gunslingor

            Mainly looking on you tube. The link you sent is the perfect example of the problem I’m having learning this platform. Second instruction “File -> New -> Project…”… but I am working in a webpage, I open the folder to start working in the project. I’ve had an sln file in there before but currently I deleted it as I thought it was causing issues. I really don’t want a bunch of proprietary files in my production folder that are solely used for the IDE and not the actual deliverable. I started a forum post to document my problems with the IDE: https://social.msdn.microsoft.com/Forums/vstudio/en-US/cfa1744b-187b-4f62-8dcd-51f26b946df7/help-me-with-this-visual-studio-nightmare-please?forum=visualstudiogeneral.

            I suspect 2 hours with a VS super user would get me moving.

          • PolyGon2013

            Keep on trying with VS. In the end, you would discover that VS is the best IDE out there. Believe me, it can be overwhelming at first. Take your time, and you will see that the time spent is well worth it. Good luck.

          • PolyGon2013

            Keep on trying with VS. In the end, you would discover that VS is the best IDE out there. Believe me, it can be overwhelming at first. Take your time, and you will see that the time spent is well worth it. Good luck.

          • PolyGon2013

            Keep on trying with VS. In the end, you would discover that VS is the best IDE out there. Believe me, it can be overwhelming at first. Take your time, and you will see that the time spent is well worth it. Good luck.

        • it took me just 10 mins of code writing code and 2 commands(Add-migration and Update-Database) to create a full fledged database using Visual Studio. Even a person like me was able to develop a website like https://theonlinecompiler.com means that ASP.NET is something really wonderful. But go ahead. Use PHP and discover yourself how poor PHP applications perform as compared to .NET There is no support for bundling and minification, no platform as secure as ASP.NET, no ide as easy to use as VS, and many more.

    • Simas Gerai

      No offense, but how many years of experience in software development do you possess? If you can’t figure out a simple Hello World application, then I have some doubts of your professionalism. I’ll recommend you to stick with PHP, buddy.

    • Simas Gerai

      No offense, but how many years of experience in software development do you possess? If you can’t figure out a simple Hello World application, then I have some doubts of your professionalism. I’ll recommend you to stick with PHP, buddy.

      • gunslingor

        Well, someone else responded to my rant so I thought I’d give an update 8 months into VS development.

        Now that I know a lot more I will say my rant is a little unjustified, but not unexpected. More precisely, if you know how to program and you start programming in any new framework there will be a learning curve, and Microsoft’s framework I do think is one of the most complicated and bloated (maybe Magento would be a close second).

        I think my biggest problem with the framework comes from idea of ‘visual programming’, it’s a great idea but I really don’t like it in practice. I’ve tried using the drag and drop but I don’t find it as intuitive as the idea of visual programming should be; additionally, I’m not always a fan of the code it creates behind the scenes. But more importantly, I think the idea of visual programming naturally led MS down the path of object oriented programming which is good… except for what I program the most, websites.

        So I think that is my issue, object orient programming for websites is a lot more trouble than its worth (in most cases). I was able to do everything with VS that I could do with PHP/javascript/CSS/HTML but I honestly felt it took longer in the MVC framework and resulted in more convoluted code. Additionally to get that dynamic functionality I actually needed I was forced to use javascript anyway.

        I am a programmer who prefers working with primitives, especially when every graphic has to be customized anyway. So, yeah, I prefer the other but I can do both now. Thanks for the emotional support people of the internet.

      • gunslingor

        Well, someone else responded to my rant so I thought I’d give an update 8 months into VS development.

        Now that I know a lot more I will say my rant is a little unjustified, but not unexpected. More precisely, if you know how to program and you start programming in any new framework there will be a learning curve, and Microsoft’s framework I do think is one of the most complicated and bloated (maybe Magento would be a close second).

        I think my biggest problem with the framework comes from idea of ‘visual programming’, it’s a great idea but I really don’t like it in practice. I’ve tried using the drag and drop but I don’t find it as intuitive as the idea of visual programming should be; additionally, I’m not always a fan of the code it creates behind the scenes. But more importantly, I think the idea of visual programming naturally led MS down the path of object oriented programming which is good… except for what I program the most, websites.

        So I think that is my issue, object orient programming for websites is a lot more trouble than its worth (in most cases). I was able to do everything with VS that I could do with PHP/javascript/CSS/HTML but I honestly felt it took longer in the MVC framework and resulted in more convoluted code. Additionally to get that dynamic functionality I actually needed I was forced to use javascript anyway.

        I am a programmer who prefers working with primitives, especially when every graphic has to be customized anyway. So, yeah, I prefer the other but I can do both now. Thanks for the emotional support people of the internet.

        • Panos Roditakis

          .Net developers are expected to be extremely productive. And they are in a way they only know. And their clients (most of the times).

  • Godminders

    How would you answer this question today given Core v1.1 RTM?

  • Amit Chaudhary

    I am designing a web application that needs to be hosted in Azure App Service.
    At present, App Service – web app supports both MVC 5.0 and Asp.Net Core. I am wondering which one I should opt. In my opinion, MVC 5.0 is industry proven, so the same is the best choice.

    But my worry is, Microsoft updates Azure PAAS regularly and what if they stop MVC 5.0 support.

    Any suggestion or guidance in this regard.

    • Jeff

      Microsoft Azure will not be dropping support for MVC 5 or any of the ASP.NET frameworks in the near future.

      ASP.NET Core is getting a lot of attention right now, but the proven .NET Framework continues to be a solid choice for development of new applications.

  • Amit Chaudhary

    I am designing a web application that needs to be hosted in Azure App Service.
    At present, App Service – web app supports both MVC 5.0 and Asp.Net Core. I am wondering which one I should opt. In my opinion, MVC 5.0 is industry proven, so the same is the best choice.

    But my worry is, Microsoft updates Azure PAAS regularly and what if they stop MVC 5.0 support.

    Any suggestion or guidance in this regard.

  • Pingback: ASP.NET Or ASP.NET Core, What To Choose? – C# Rescue()

  • Panos Roditakis

    Google’s search for various topics on MVC, already brings too many results related to core on top. The same with xamarin. New technologies are faster in addopting these days and get in production very fast, no matter if is a JavaScript framework, a back-end or authoring tool. By the time you decide which to use, a new version is out and thousands of projects are delivered world wide.

  • Panos Roditakis

    Google’s search for various topics on MVC, already brings too many results related to core on top. The same with xamarin. New technologies are faster in addopting these days and get in production very fast, no matter if is a JavaScript framework, a back-end or authoring tool. By the time you decide which to use, a new version is out and thousands of projects are delivered world wide.

    • Yes, impossible to keep up with all the releases. Microsoft’s footprint continues to get deeper.

    • Yes, impossible to keep up with all the releases. Microsoft’s footprint continues to get deeper.