How to handle 404 Not Found errors effectively with ASP.NET MVC 4

There have always been a lot of confusion regarding handling 404 errors in ASP.NET MVC. Many programmers have been using different methods to handle 404 errors. Here is a yet another discussion, where people have posted various ways to handle 404 errors.

NotFoundMvc.
So here’s a new and improved way to handle 404 errors in ASP.NET MVC. Kudos to Andrew Davey for making such an awesome plugin.

NotFoundMVC - Provides a user-friendly 404 page whenever a controller, action or route is not found in your ASP.NET MVC3 application.
A view called NotFound is rendered instead of the default ASP.NET error page.

You can add this plugin via nuget using:
Install-Package NotFoundMvc

NotFoundMvc automatically installs itself during web application start-up. It handles all the different ways a 404 HttpException is usually thrown by ASP.NET MVC. This includes a missing controller, action and route.

Step by Step Installation Guide :
1. Right click on your Project and Select Manage Nuget Packages...

2. Search for `NotFoundMvc` and install it.
Install Nuget Extension
3. Once the installation has be completed, two files will be added to your project. As shown in the screenshots below.

4. Open the newly added NotFound.cshtml present at Views/Shared and modify it at your will. Now run the application and type in an incorrect url, and you will be greeted with a User friendly 404 page.
Final Output

No more, will users get errors message like Server Error in '/' Application. The resource cannot be found.

Hope this helps :)