Tech Junkie Blog - Real World Tutorials, Happy Coding!: End-to-End ASP.NET MVC : Create an ASP.NET MVC Empty Project

Saturday, June 18, 2016

End-to-End ASP.NET MVC : Create an ASP.NET MVC Empty Project

A lot of people think that you can only create one kind of ASP.NET MVC  project, the one with the sample application.  But the reality is that you can create an Empty ASP.NET MVC, you just need to do more work.  However, it is cleaner and you can add what you need, instead of having everything in place already like the default template.  So you might run into more errors with the empty project, but I think you will learn more about MVC than if you just have the default template.  Plus it's more streamline.  I always start with an empty project on my MVC projects.  In order to follow this tutorial you must have Visual Studio 2017 installed.

Step-By-Step Instructions:
  1. Create a new project in Visual Studio call "NorthwindCafe", by clicking on File → New → Project
  2. Select Visual C# → Web → ASP.NET Web Application, in the "Name:" field type the name "NorthwindCafe", then click "OK"

 3.  On the next screen select "Empty" on the "Select a template" menu, then under "Add folders and core references for:", check the "MVC" checkbox.

 4.  Your empty ASP.NET MVC  project is created in Visual Studio 2017

5.  We are not done yet,  since this is an empty project we will get an error if we try to run the application.  Hit "Ctrl+F5" to run the application.  You will get this message

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3056.0

The reason you are getting a 404 error is because there's no "Controller" or "View" to browse to.  Since we just created a bare bones ASP.NET MVC  project.

6.  So to get the application to run we will create a simple Controller and View in the MvcApp project.

7. Right click on the "Controller" folder and select "Add" → "Controller"

8.  On the "Add Controller" screen type "HomeController" on the "Controller name" text box and select "Empty MVC controller".  We just want to keep things simple for this blog.  Then click "Add"

9.  You see the "HomeController.cs" class being added to the "Controllers" folder

HomeController configuration

10.  Double click on the "HomeController.cs" file and you will see the following code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace NorthwindCafe.Controllers
    public class HomeController : Controller
        // GET: /Home/

        public ActionResult Index()
            return View();


11.  Right click on the "Index()" method and select "Add View"

Add View To Index method

12.   Uncheck the "Use a layout or master page" checkbox. Accept the default settings, MVC uses conventions so the view has the same name as the method name in the "HomeController.cs" file which is "Index()", then click "Add"

13.  In the "Views" folder you see that the "Home" folder has been created with the view "Index.cshtml", the .cshtml extension means that the view uses the C# syntax.

14.  Double click on the view "Index.cshtml" and type "Hello World" between the <div> tag like the markup below

    Layout = null;

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
        Hello World!

15. Press Ctrl+F5 to run the application, you will see the following.

Browse Hello World View

16.  Now that we have a working empty ASP.NET MVC project, we need add the items to the projects using NuGet.

Similar Posts:

                                                                                               Next: ASP.NET : Add jQuery Library Using NuGet


  1. Hello,

    I followed your tutorial step by step I still get The resource cannot be found.

    I don't know what seems to be the problem.

    I am using VS express 2012 but I have added the plugin to use MVC5 so I created an epmty mvc5 project


  2. What step are you stuck on? I used Visual Studio 2013 the full version so the steps might be a little different.

  3. Actually I think I was using Visual Studio Community Edition 2013 you can get it here at

  4. Hello,

    I have the same problem of Sabrine Azouz, in the step 15 when trying to run the application, get the resource cannot be found error

  5. I had the same trouble, but it went away when I restarted Visual Studio. I'm using VS2015 community, and everything works fine. Thanks Jason, great article.

  6. Thank you so much for writing this. I have been looking for a long time for a set of tutorials that starts without everything auto-installed, allowing you to add things as you need them so you understand what's going on. This is fantastic.

  7. Thanks for this. It was really helpful!

  8. Hey, I just wanted to mention that these instructions worked perfectly using Monodevelop 5.10 on a Fedora 23 box. The only deviation from these instructions that I had to do was to create a registry directory. Like so...

    sudo mkdir /etc/mono/registry
    sudo chmod uog+rw /etc/mono/registry/

    Thanks for your efforts in putting together this tutorial!

    1. I'm using Debian 8.x and the directory already exists.


  9. Thanks I've been looking for good tutorial that would start from scratch. Most of the books I see use MVC template..

  10. Thank u so much. Explained in such a easy and simple way. Really helpful.

  11. I am using vidual studio 2015.I have created mvc empty web application.
    I have created 2 webpages in aspx.also created controller for both.
    when i buld the project one page gets loaded successfully in browser.

    On click of a buuton on one page second page shuld be anchor tag does in html.
    Can you help me with that?

    1. I would recommend that you remove the .aspx page. Since this is an MVC application and razor is the view template that Microsoft is pushing. It would make your life a lot easier if you stick with razor

  12. thanks dude. I was going bonkers trying to get a simple one page mvc website running. This got me going in the right direction

  13. Really excellent tutorial gives very in-depth picture how actually thing works sir

  14. This comment has been removed by a blog administrator.

  15. This comment has been removed by a blog administrator.

  16. Very Nice blog. Really helpful information about ASP …. Please keep update some more…………

  17. nicely explain the process to create mvc project

  18. This comment has been removed by the author.

  19. Well done, man.
    It wasn't easy to find the answer for a new developer in ASP as miself.

  20. This comment has been removed by a blog administrator.

  21. This comment has been removed by a blog administrator.

  22. This comment has been removed by the author.

  23. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Best UIPath Robotic Process Automation Course Training Institute in kanchipuram|

  24. Thanks for delivering a good stuff related to GCP, Explination is good, Nice Article.
    GCP Online Training
    Google Cloud Platform Training In Hyderabad

  25. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
    RPA Training in chennai |RPA Training course chennai

  26. Useful information Thank-you for sharing. really helpful keep sharing your views. Please visit link mentioned below and share your views on them.
    best hvac training in lucknow
    job oriented training institute in lucknow
    best php training in lucknow
    digital marketing training in lucknow


  27. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    top microservices online training

  28. If u are looking for Management Assignment Help visit at we provide Management Assignment Help across the world at very affordable prices.
    Management Assignment Help


Search This Blog