ReviewCoreASP.NET | Best and cheap ASP.NET MVC Core 1.0 hosting. The best way to learn new technologies is via comparing with the old and find out what has changed. In this post, find out the difference between ASP.NET MVC 5 and ASP.NET MVC Core 1.0 aka ASP.NET MVC 6. The difference list is quite long as ASP.NET Core 1.0 is re-written. The basic of MVC still remains the same and we can say that from coding perspective there aren’t many changes but there are framework level changes, project structure changes, hosting and deployment changes and many more. So let’s dive in.

[su_note note_color=”#59e0c4″ text_color=”#ffffff”]

ASP.NET MVC 5  vs  ASP.NET CORE MVC 1.0

[/su_note]

[su_note note_color=”#d9ae89″ text_color=”#0f0d0d”]

ASP.NET CORE MVC 1.0 is Cross Platform.


ASP.NET Core MVC 1.0 is Cloud Ready.


MVC + Web API + Web Pages = ASP.NET Core MVC 1.0


ASP.NET Core MVC 1.0 doesn’t need IIS for hosting.

Since ASP.NET Core is to cross platform so you can host ASP.NET 5 applications not only on IIS but they can be self hosted or use kestrel web server on linux.

ASP.NET Core MVC 1.0 has inbuilt support for Dependency Injection.

ASP.NET Core MVC includes a simple built-in container (represented by the IServiceProvider interface) that supports constructor injection by default, and MVC makes certain services available through DI.

ASP.NET Core MVC 1.0 has a new project solution structure.

There is no App_Start, App_Data, Global.asax and root web.config file. App_Start is replaced by Startup.cs and web.config is replaced by appsetting.json. There is also a new configuration system, where JSON is preferred over XML for configuration settings.

Roslyn compiler for compiling code dynamically.

Now no need to compile your code, on any code changes that you make. Thanks to Roslyn in memory compilation. Just make changes -> save it and view in browser.

In ASP.NET Core MVC 1.0 “wwwroot” is now place for static files.

wwwroot directory in project is for static content like css, Js, images. And it’s the
default root of your server. If a request comes in for a static file on disk, if the file is in this folder then it can go back to client. The name can be changed from project.json file.

The new Project.json file defines dependencies, runtime to use, and defines build and publish setup, instead of .csproj file.

Everything is Nuget package in Core MVC 1.0. There is no dll by default.


Bundling and minification is done using Grunt or Gulp, unlike defining bundles in BundleConfig file.

Manage client side dependencies via NPM and Bower.


ASP.NET MVC 5 Child actions are gone. They are now replaced with View Components.

Introduction of _ViewImports.cshtml in Core MVC 1.0

It provides namespaces which can be used by all other views. In previous MVC projects, this was provided by the web.config file in the Views folder; since the web.config no longer exists, global namespaces are now provided by this file.

Introduction of Tag helpers.

Tag Helpers allows to enable server-side code to participate in creating and rendering HTML elements in Razor files.

It also support RESTful style routes with attribute routing

That means you can even declare RESTful like routes like [HttpGet(“Our Route”)] and [HttpPost(“Our Route”)]


In Core MVC 1.0, routes have new [controller] and [action] tokens.

These tokens allows you to reference controller and action names in the route template. These token are helpful when in future if you rename the controller or action, there is no need to update the routes.
 [/su_note]

 

Leave a Reply

Your email address will not be published. Required fields are marked *