No ASP.NET MVC 5 Web Application Template on VS 2012?

23,077

Solution 1

After creating a new project using ASP.NET MVC 5 Empty Project, you can right click on the project, then click Add.. > New Scaffolded Item..., select MVC on the left, then MVC 5 Dependencies and choose Full dependencies from the prompt.

This will add a default layout (Views\Shared\_Layout.cshtml), Content folder, Scripts folder with bootstrap, jquery, modernizr, etc, and other things the Web Application template creates.

If you get the error "CS0103: The name 'Styles' does not exist in the current context" just add <add namespace="System.Web.Optimization"/> under <namespaces> in Views/web.config

Solution 2

The answer from Sean Lynch is nice but not really complete.

However there is this nice guy that took the time to prepare the template just like in Visual Studio 2013. You will get everything down to the bootstrap template and pre-configured database table for authentication.

All you need to do is change the DefaultConnection in Web.Config to you SQL Server and voila all the relevant authentication table will be created for you.

Archive of the original blog (by web.archive.org)

Update

The original blog is no longer online, but thankfully his template is still online. You can download the MVC5 Template for Visual Studio 2012 Here:

Direct link to MVC5 Template For Visual Studio 2012

And here is the excerpt from the original blog:


Installing the template is very simple, there are just two steps:

Copy it into the following folder of your computer (creating the directory structure if necessary):

%USERPROFILE%\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#\Web

Once you’ve done this, simply restart Visual Studio and you will have this template available in the dialog box to create a new project under “Visual C# > Web”.

Now you can create applications with a little more shape than the mere empty structure provided by default and enjoy the benefits of adopting Bootstrap and its responsive design, a full membership system and user authentication, bundles, filters, some content pages, etc.


Solution 3

You have 2 option to fix it.

  1. Install the latest 2013 version which have MVC5 support inbuilt (VS2013 missing MVC3 and ASPX file template (ASPX templates will be added in future))

  2. stay with 2012 update 4. Read my old article to get it fixed http://geekswithblogs.net/anirugu/archive/2013/11/28/mvc-5-in-visual-studio-2012-update-4.-how-to.aspx

Share:
23,077
user1987392
Author by

user1987392

Updated on March 12, 2020

Comments