ASP.NET MVC 5 web application template on VS 2012?

I am using Visual Studio 2012 and have just installed "Microsoft ASP.NET and Web Framework 2013.1 - Visual Studio" .

As expected, he added the ability to create an "ASP.NET MVC 5 Empty Project" . The fact is that I don’t see the possibility of switching to an already functional “base application” , as it was when using MVC 4 (for example, "Asp.NET MVC 4 Web Application" ). I see only an empty template.

I saw the answers, for example:

  • How to add MVC 5 project template in VS 2012?

  • Create and run MVC 5 project in VS 2012

  • Direct download link for ASP.NET MVC 5 for VS 2012

And I found this article on this subject.

This is obviously not a show stopper, since I can always create an application from scratch, but I still would like to know if this can be achieved at VS 2012. I skipped a step or do I need VS 2013 for this? A fully functional web application template (with authentication, etc.) Would be good to use the new features of MVC 5 or for prototyping.

+61
visual-studio-2013 asp.net-mvc visual-studio-2012 asp.net-mvc-4 asp.net-mvc-5
Dec 16 '13 at 9:44
source share
4 answers

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 select Full dependencies from the prompt.

This will add the default folder ( Views\Shared\_Layout.cshtml ), Content , Scripts folder with boot, jquery, modernizr, etc. and other elements created by the web application template.

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

+78
Feb 18 '14 at 4:33
source share

The answer from Sean Lynch is good, but not quite complete.

However, there is that nice guy who took the time to prepare the template, as in Visual Studio 2013. You will get everything up to the bootstrap template and a pre-configured database table for authentication.

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

Source Blog Archive (by web.archive.org)

Update

The original blog is no longer online, but fortunately its template is still online. You can download the MVC5 template for Visual Studio 2012 here:

Direct link to the MVC5 template for Visual Studio 2012

And here is an excerpt from the original blog:




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

Copy it to the following folder on your computer (if necessary, create a directory structure):

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

Once you do this, just restart Visual Studio and you will get this template in the dialog box to create a new project under "Visual C #> Web".

Now you can create applications with a slightly larger form than the simple empty structure provided by default and take advantage of using Bootstrap and its responsive design, a full membership system and user authentication, packages, filters, some content pages, etc.




+34
Jun 12 '14 at 8:00 a.m.
source share

You have 2 options to fix this.

+1
Feb 18 '14 at 5:26
source share

I do not use 2012 now, but rather 2013, and I see the mvc 5 template. However, I did this a while ago before I had any mvc 5 templates that appeared by installing mvc 5 first. You can download http://www.asp.net/mvc/mvc5 . Also make sure the target structure is configured correctly. Then I updated the web configuration as follows: You must have the correct build versions. I searched a lot to get this information, so it should be available if you do some research.

0
Mar 06 '15 at 0:05
source share



All Articles