I'm using Visual Studio 2012 and have just installed "Microsoft ASP.NET and Web Frameworks 2013.1 - Visual Studio".
As expected, it added the option to create an "ASP.NET MVC 5 Empty Project"
. The thing is, I see no way of jump-starting an already functional "base application" as I had when I was using MVC 4 (e.g. "Asp.NET MVC 4 Web Application"
). I only see an empty template.
I've seen answers such as:
How can I add the MVC 5 project template to VS 2012?
Create and Run MVC 5 Project in VS 2012
Direct download link to ASP.NET MVC 5 for VS 2012
And found this article on the matter.
This is obviously not a show-stopper as I can always create the application from a scratch, but I still would like to know if it is possible to achieve that on VS 2012. Did I miss a step, or do I need VS 2013 for that? A fully functional Web application template (with authentication etc.) would be nice to dabble around MVC 5's new features or for prototyping.
In Visual Studio, choose File > New Project. On the left, expand Visual C#, select Web, and then select ASP.NET Web Forms Application.
Run Visual Studio 2012 Express for Web, to do this go to Start and type VS Express for Web then press Enter. From the File menu, select New Project. Select the Visual C# | Web project type from the project type tree view, then select the ASP.NET MVC 4 Web Application project type.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With