.NET Core - MVC

Observations about .NET Core, MVC and converting YetaWF from ASP.NET MVC5 to .NET Core MVC. The new .NET Core has great new features. Getting there from an existing MVC 5 app is HARD!

Compatibility Be Damned!


After working with ASP.NET Core MVC I have a few opinions about it. Do I like it? Yes. But, while it looks like a solid new release, with some nice new features, I can't shake the feeling that this was developed by some very smart people with absolutely no experience in the business (real) world and marginal experience with large MVC applications or maybe just a superficial knowledge of MVC5. Or maybe they just didn't care about compatibility. There are so many changes which make existing applications utterly incompatible, not to mention breaking changes, and some issues with the tools, like Visual Studio, so this is not a pleasant upgrade experience.  Actually, it's not an upgrade. You will be redeveloping a significant portion of your code! And retesting... Granted, a basic MVC app won't have any major problems to upgrade to ASP.NET Core MVC. But if you have invested in MVC3-5 you most likely made some significant additions, like deriving from the controller base classes, razor page classes, added scaffolding enhancements, custom display/editor templates, etc. These are all areas that were significantly changed.

On the surface, a redesigned MVC, along with significant changes in ASP.NET Core, may seem like a good idea. Sure, any developer gets excited over the new "goodies" in ASP.NET Core MVC. But, there are thousands if not hundred of thousands of businesses that run mission critical (at least to them) sites using ASP.NET 4 & MVC5. The cost of upgrading a site, given the amount of effort it takes, is significant! Just stay with ASP.NET 4? Seriously? I have run sites for years, but eventually, you're always forced to upgrade.

So, ASP.NET Core is a significant new version, with many incompatibilities to its predecessor. These changes, on their own, are certainly manageable.

It looks like the MVC folks looked at the new version of ASP.NET Core (formerly ASP.NET 5), and decided that this is the time for radical change. Clearly this is just my opinion: So they went off and took this opportunity to introduce a ton of changes, including breaking changes. Maybe in their mind, all the ASP.NET 5 changes would justify the MVC changes...  Having just gone through a massive upgrade, let me state that the ASP.NET Core changes amounted to maybe 1% of the overall changes. 99% of the changes (definitely most of the pain!) are directly attributable to MVC.

Then, a new project file format was introduced in Visual Studio (*.xproj) along with Bower support, new project settings, a new way to define dependencies (project.json), and more. These are all good things. Well in theory. In reality, Visual Studio 2015 (with the latest, released toolset) has never crashed this often for me (now multiple times a day, February 2017). Sometimes changes to project.json would hang Visual Studio. There are significant features in Visual Studio that are missing with the new projects: You can't exclude files from a project (this will be addressed in the future) and you can't reference a .xproj project from a .csproj project in the same solution. This means that you have to convert all projects to .xproj. Not an option for regular, plain old assemblies. Of course, future upgrades of the toolset will alleviate these problems. In my opinion this really means ASP.NET Core MVC is not ready for prime time... The supporting tools are not ready (today - 2/23/2017). Then along came Visual Studio 2017 with an improved toolset, and we're back to .csproj project files. So we can dump all the knowledge and blogs out there showing us how to do things with project.json and .xproj! Talk about great planning...

ASP.NET Core MVC can run on platforms other than Windows. Nice! Useful for existing projects? Not so much. My company is definitely a Microsoft shop and we make money off of Microsoft's product limitations. So we have servers that run Windows Server 201x and we have Windows expertise. Are we going to switch? Absolutely now. Anyone who runs sites based on MVC 3, 4, or 5 runs on Windows. So that only leaves new "people". They will love running ASP.NET Core MVC on Linux or whatever. Does this mean Microsoft just said "forget everyone who is upgrading, we need NEW users"? It certainly looks that way from where I'm sitting.

ASP.NET Core MVC 1.0 was released in June 2016 (followed by 1.1). 8 months later is it ready for real world production use to upgrade existing MVC 3, 4, 5 apps? I don't think so. Unless you're willing to invest time ( == $$$ ).

No Comments

Be the first to add a comment!

Add New Comment

Complete this simple form to add a comment to this blog entry.