如何在我的 ASP.NET MVC 5 项目中获得“添加控制器"和“添加视图"菜单选项? [英] How do I get the “Add Controller” and “Add View” menu options in my ASP.NET MVC 5 project?
问题描述
我在 Visual Studio 2012 中使用 本教程. 在最后一步中,我删除了 ProjectTypeGuid对于来自我的 .csproj
文件的 MVC 4.
I upgraded my solution from MVC 4 to MVC 5 in Visual Studio 2012 using this tutorial. In the last step I removed the ProjectTypeGuid for MVC 4 from my .csproj
file.
现在的问题是,当我想创建新的控制器/视图时,我在 Visual Studio 中看不到 Add Controller、Add View.
Now the problem is that I don't see Add Controller, Add View in Visual Studio when I want to create new Controllers/Views.
我阅读了 这个 MVC 4 的答案 所以我知道我需要为 MVC 5 获取正确的 ProjectTypeGuid 才能重新获得该功能.我想知道是否有人知道那是什么,以便我可以将它们添加到我的 .csproj
文件中?
I read this answer for MVC 4 so I know I need to get the correct ProjectTypeGuid for MVC 5 in order to regain that functionality. I was wondering if anyone knows what that is so that I can add them to my .csproj
file?
推荐答案
安装以下项目:
- Visual Studio 2012 更新 4
- 适用于 Visual Studio 2012 的 Web 工具 2013.1(Web 平台安装程序 | 直接下载)
最后确保您的项目具有以下 ProjectTypeGuids:
Finally make sure your project has the following ProjectTypeGuids:
<ProjectTypeGuids>
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>
在 MVC5 中,您要查找的选项可能隐藏在 Add Scaffold 菜单选项下.请参阅发布博客 发表有关 MVC5 脚手架的更多信息.
In MVC5 the option you're looking for might be hidden under the Add Scaffold menu option. See the release blog post for more information on MVC5 scaffolding.
一些信息来自:http://forums.asp.net/t/1950055.aspx
这篇关于如何在我的 ASP.NET MVC 5 项目中获得“添加控制器"和“添加视图"菜单选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!