没有ASP.NET MVC 5 Web应用程序模板在VS 2012? [英] No ASP.NET MVC 5 Web Application Template on VS 2012?
问题描述
我在使用Visual Studio 2012和刚刚安装<一href=\"http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx\">\"Microsoft ASP.NET和Web框架2013.1 - Visual Studio的
I'm using Visual Studio 2012 and have just installed "Microsoft ASP.NET and Web Frameworks 2013.1 - Visual Studio".
正如预期的那样,它添加了一些选项来创建一个ASP.NET MVC 5空项目
。关键是,我没有看到跳开始已经是功能基础应用的方式,因为我我使用MVC 4时,有(如Asp.NET MVC 4 Web应用程序
)。我只看到空的模板。
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.
我见过的答案,如:
-
<一个href=\"http://stackoverflow.com/questions/18288215/how-can-i-add-the-mvc-5-project-template-to-vs-2012\">How我可以在MVC 5项目模板添加到VS 2012?
<一个href=\"http://stackoverflow.com/questions/17968304/create-and-run-mvc-5-project-in-vs-2012/19560412#19560412\">Create和运行MVC 5项目VS 2012
<一个href=\"http://stackoverflow.com/questions/19608175/direct-download-link-to-asp-net-mvc-5-for-vs-2012?lq=1\">Direct下载链接ASP.NET MVC 5 VS 2012
和发现这篇文章对此事的。
这显然不是一个表明,塞,因为我总是可以创建一个从从头申请,但我还是想知道它是否可能实现,关于2012年VS我错过了一步,或者我需要VS 2013是什么?一个功能齐全的Web应用程序模板(身份验证等)将是不错的涉猎各地MVC 5的新功能或为原型设计。
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.
推荐答案
使用 ASP.NET MVC 5空项目
创建一个新项目后,您可以右键点击项目,然后单击添加...
> 新建项目脚手架...
,选择 MVC
在左侧,那么 MVC 5依赖
,然后选择全依赖
从提示。
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.
这将增加一个默认的布局(视图\\共享\\ _Layout.cshtml
),内容
文件夹,脚本
与引导,jQuery的,Modernizr的,等等,和其他东西的Web应用程序模板创建的文件夹。
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.
如果你得到错误CS0103:名称'风格'不在目前情况下存在只需要添加&LT;添加命名空间=System.Web.Optimization/&GT;
在&LT;&命名空间GT;
中的查看/ web.config中的
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
这篇关于没有ASP.NET MVC 5 Web应用程序模板在VS 2012?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!