的Visual Studio 2013按钮,添加一个视图被禁用 [英] Visual Studio 2013 button to add a View is disabled

查看:372
本文介绍了的Visual Studio 2013按钮,添加一个视图被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建一些意见后,在 AddView>添加按钮遭停用,我不能添加的看法了。
有没有人有一个提示有关?

修改

我可以使用添加新项意见添加的命令,然后选择查看,但它的废话给我。


解决方案

您很可能现在解决了这一点,但我想我会加入我的答案给别人这个问题的痛苦。

这同样的问题发生在我身上,而解决办法是编辑的.csproj文件来告诉Visual Studio中,这是一个MVC项目。

这里就是你要做的:

1)打开一个文本编辑器中MVC项目的.csproj文件(记事本是罚款)。

2)求标签。

3)对于Visual Studio 2013就应该这样写的(可能在2012年也可以):

<$p$p><$c$c><ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

4)保存更改 - Visual Studio将检测到它们并重新加载的项目

这也是为什么你做到这一点:

在.csproj的文件中的所有该行确实是告诉Visual Studio的是哪种类型的项目。

E3E379DF-F4C6-4180-9B81-6769533ABE47 = ASP.NET MVC 4.0

349c5851-65df-11DA-9384-00065b846f21 = Web应用程序

fae04ec0-301f-11D3-bf4b-00c04f79efbc = C#

在你的情况,我希望E3E379DF-F4C6-4180-9B81-6769533ABE47丢失,所以VS不知道,这是一个MVC项目,因此不会允许你添加视图和控制器。

您可以在这里查找各种的GUID的情况下,你需要他们。的http://www.$c$cproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs

我希望这是给你的帮助。

After creating a few views, the AddView>Add button became disabled and I can't add views anymore. Does anyone have a hint about that?

EDIT

I can add views using the Add New Item command and selecting Views, but it's nonsense to me.

解决方案

You may well have solved this by now, but I thought I'd add my answer for others suffering with this issue.

This same issue happened to me, and the solution was to edit the .csproj file to tell Visual Studio that it was an MVC project.

Here's what you do:

1) Open up the .csproj file of the MVC project in a text editor (Notepad is fine).

2) Find the tag .

3) For visual Studio 2013 it should read like this (may work for 2012 also):

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

4) Save the changes - Visual Studio will detect them and re-load the project.

Here's why you do it:

All that line in the .csproj file does is tells Visual Studio which type of project it is.

E3E379DF-F4C6-4180-9B81-6769533ABE47 = ASP.NET MVC 4.0

349c5851-65df-11da-9384-00065b846f21 = Web Application

fae04ec0-301f-11d3-bf4b-00c04f79efbc = C#

In your case, I expect E3E379DF-F4C6-4180-9B81-6769533ABE47 is missing, so VS doesn't know that it's an MVC project, therefore won't allow you to add Views and Controllers.

You can look up the various guids here in case you ever need them. http://www.codeproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs

I hope this is a help to you.

这篇关于的Visual Studio 2013按钮,添加一个视图被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆