Blog
What's new in MVC 5.2
By Martin Schaeferle | October 08, 2014
Microsoft's very successful model-view-controller architecture, or MVC, has been their flagship framework for developing next generation Web applications-and Microsoft continues to improve it with version 5.2 released just over two months ago. If you're still hanging on to MVC 4, you're missing out on many new and exciting features, and Microsoft has made the path to upgrade easier than ever. So what's so exciting about MVC 5? Let me start by hitting you with some of the big improvements with this latest release. If you want even more information or want to see some demonstrations of these new features, please check out our MVC 5.2 courses with expert Eric Greene.
One ASP.NET
In MVC 5, Microsoft introduced a new project type called One ASP.NET. This project type has the goal of saving the Web developer's time by reducing the clutter of many single-focused Web templates constantly growing within Visual Studio. One ASP.NET creates a more "a la carte" model for creating applications so the developer can start with core functionality, and then add more and more components as various features and functionality are required. This allows developers to combine ASP.NET Web Forms, MVC, Web API and other project templates into a single project and not be restricted to use only one of them.
Bootstrap
From the brilliant minds of the Twitter software engineers came a CSS and JavaScript framework that has quickly become one of the most popular tools for front-end development. Bootstrap provides user interface tools and controls that allow developers to build rich Internet applications that auto-respond to changing screen sizes and devices. It takes away the drudgery of constantly tinkering with the CSS and JavaScript code necessary to get your site to perform professionally for all of your users. Microsoft now includes Bootstrap templates in MVC 5 so you can take advantage of all its features right out of the box. In fact, Bootstrap is now the default HTML/CSS/JavaScript framework bundled with ASP.NET MVC. Bootstrap is managed by NuGet which means it can be automatically upgraded as the technology advances. You can discover more about Bootstrap by taking a look at our Bootstrap 3.1 courses with expert Adam Barney.
ASP.NET Identity
Before ASP.NET MVC 5, Microsoft had promoted its Membership Provider to handle security, authentication, and roles for your Web applications. But with the ASP.NET Identity, they completely rebuilt their security solution to include a whole new range of features. It still contains all the core functionality for authentication and authorization, but it also extends to support new forms like two-factor authentication (2FA) and integrated authentication. With 2FA, you can require multiple forms of authentication like the Google Authenticator or SMS text messaging. Integrated authentication allows you to work with many existing third-party providers like Google, Facebook, and Twitter. It allows your users to access your site using credentials from these and other providers, freeing you from the responsibility of managing credentials, and not forcing your users to memorize yet another password.
New Filters
Authorization filters have been around for quite a while in ASP.NET and have been a staple for most developers who need to set up security for their Web applications. Authentication filters, on the other hand, are new to MVC 5. These new filters allow for programming logic to occur before the authorization filter, giving developers the ability to better identify and control users entering their site. For example, developers can now assign a new authentication principal (think of it like a role) to a user logging in prior to the authorization filter, giving them better control at the individual Action/Controller level. Think of the authorization filter as providing a more global security model, one that covers the site as a whole, while the authentication filter provides a more specific security model that can be applied at more localized level. Another new filter enhancement is filter overrides. Filter overrides allow you to define filters that apply to most of your application, either at the global level or at the controller level, but then have the option to actually override or turn off those filters at the action level or controller level.
Upgrading from MVC 4
Microsoft has made upgrading easy and painless for the developer. In a nutshell, most applications will simply need to update their NuGet packages, plus make a couple of web.config changes, and they will be off and running. The NuGet services manage all the individual components or packages that your Web application utilizes, like Razor and Bootstrap, and make sure that they are all on the latest releases relative your version of MVC. Keep in mind that in addition to moving to MVC 5, there are minor releases coming out as well. At the time of this writing, there have been 5.1 and 5.2 releases, but by the time you read this there may be 5.3 available and beyond. Regardless, migrations at this level are equally straightforward in their upgrade process. Keep in mind that in many cases the migration forward is a one-way proposition. With each upgrade, your application is exposed to more and more features and functionality, which means you can't go back once you start using it. But hey, why would you go back, right? Finally, it's not just ASP.NET MVC that is gaining new features-ASP.NET Web API, Razor, SignalR, Entity Framework, NuGet and many others are also improving. LearnNowOnline can help you keep up with the latest releases so you can be the best Web developer you can be. Check out our complete course list.