上下文菜单没有“添加脚手架”或“添加控制器”选项

时间:2022-12-14 07:26:53

I'm trying to get started with ASP.NET/C#, and I'm doing so by following along some guides and tutorials.

我正在尝试使用ASP.NET / C#,我正在按照一些指南和教程进行操作。

One major issue I keep running into is that I have no Add Scaffolding in the context menu, nor Add Controller. I can't figure out a workaround for the lack of the Add Scaffolding.

我一直遇到的一个主要问题是我在上下文菜单中没有Add Scaffolding,也没有Add Controller。我无法找到缺少Add Scaffolding的解决方法。

上下文菜单没有“添加脚手架”或“添加控制器”选项


There are various relate posts on SO. I will address some:

SO上有各种相关帖子。我将解决一些问题:

  • How to Add Controller

    如何添加控制器

    The accepted answer says something that directly contradicts my experience. There is no Add Controller option anywhere.

    接受的答案说明了与我的经历直接矛盾的事情。任何地方都没有添加控制器选项。

  • Reload the project

    重新加载项目

  • Reinstall suggested in this comment

    重新安装在此评论中建议

    I've tried uninstalling and reinstalling several versions. So far I've tried VS2013 Express for Web, VS2013 Community, and right now I'm using VS2013 Ultimate. Each one has had a fresh install installed within the month.

    我已经尝试卸载并重新安装多个版本。到目前为止,我已经尝试过VS2013 Express for Web,VS2013社区,现在我正在使用VS2013 Ultimate。每个月都安装了全新安装。

  • Add a guid

    添加一个guid

    I tried adding a guid to a .proj file, an idea from another question at the moment of which I cannot find.

    我尝试在.proj文件中添加一个guid,这个问题来自另一个我无法找到的问题。

  • Same issue in Sep 2014, no answer

    同样的问题在2014年9月,没有答案

    I realize there are several questions with the same issue, but none of the answers address my situation. Of the solutions I've seen proposed, I can't get any of them to work. Maybe I'm copying the guid's in the wrong place, maybe I'm not uninstalling correctly, I'm not sure.

    我意识到同一个问题有几个问题,但没有一个答案能解决我的情况。在我看到的解决方案中,我无法让它们中的任何一个起作用。也许我在错误的地方复制guid,也许我没有正确卸载,我不确定。

I haven't yet tried to uninstall everything related to VS. I have a lot of random product on this machine. I wasn't aware that, for example, "Microsoft Visual Studio 2010 Tools for Office Runtime (x64) or Microsoft Visual Studio Tools for Applications 2.0 - ENU could disrupt VS2013 features. If anyone has information about this please let me know. I don't know the extent to which I would have to uninstall stuff in order to find the root of this issue. My Programs and Features menu is littered with MS product that I can barely tell apart.

我还没有尝试卸载与VS相关的所有内容。我在这台机器上有很多随机产品。我不知道,例如,用于Office运行时的Microsoft Visual Studio 2010工具(x64)或用于应用程序2.0的Microsoft Visual Studio工具 - ENU可能会破坏VS2013的功能。如果有人有这方面的信息,请告诉我。我不知道。我不知道在多大程度上我必须卸载东西才能找到这个问题的根源。我的程序和功能菜单上到处都是MS产品,我几乎无法区分。

EDIT:

Some Background Info:

一些背景信息:

I am using Microsoft Visual Studio Ultimate 2013 Version 12.0.31101.00 Update 4, and Microsoft .NET Framework Version 4.5.50938.

我使用的是Microsoft Visual Studio Ultimate 2013版本12.0.31101.00 Update 4和Microsoft .NET Framework版本4.5.50938。

I used no special install instructions.

我没有使用特殊的安装说明。

It's a web application. File > New Project... > Installed..Templates..Visual C#..Web..ASP.NET Web Application > MVC.

这是一个Web应用程序。 File> New Project ...> Installed..Templates..Visual C#.. Web..ASP.NET Web Application> MVC。

Upon Dleh's suggestion, I looked for the Add > ... buttons after changing the project type. I selected File > New Project ... > Visual Studio 2012 > ASP.NET MVC 4 Web Application (.NET Framework 4.5.1) > Internet Application, and I am confused to report that there is an Add > Controller... button. I have no idea what is happening.

根据Dleh的建议,我在更改项目类型后查找了Add> ...按钮。我选择了文件>新建项目...> Visual Studio 2012> ASP.NET MVC 4 Web应用程序(.NET Framework 4.5.1)> Internet应用程序,我很困惑地报告有一个添加>控制器...按钮。我不知道发生了什么。

Also, of note, I (within the week) installed VS2013 Ultimate on my home machine, and I have having none of these issues.

另外值得注意的是,我(在一周内)在我的家用机器上安装了VS2013 Ultimate,而且我没有遇到这些问题。

上下文菜单没有“添加脚手架”或“添加控制器”选项

2 个解决方案

#1


0  

I believe I have solved the issue, but I don't know exactly what I did.

我相信我已经解决了这个问题,但我不确切知道我做了什么。

上下文菜单没有“添加脚手架”或“添加控制器”选项

One answer from here was part of what prompted me to uninstall a number of MS products and features. Unfortunately, I can't remember the exact program or feature I uninstalled.

这里的一个答案是促使我卸载大量MS产品和功能的部分原因。不幸的是,我不记得我卸载的确切程序或功能。

It seems like the uninstalling of related programs and features fixed the issue. By "related programs and features" I mean anything in the Control Panel > All Control Panel Items > Programs and Features menu that had ".NET" or "Visual Studio" or "Microsoft * Web Tools" or of the like. Many of them required a system reboot after uninstalling, and after one system reboot, the desired features in VS2013 was there.

似乎卸载相关程序和功能解决了这个问题。 “相关程序和功能”是指“控制面板”>“所有控制面板项目”>“程序和功能”菜单中包含“.NET”或“Visual Studio”或“Microsoft * Web工具”等的任何内容。其中许多需要在卸载后重新启动系统,并且在一次系统重启后,VS2013中的所需功能就在那里。

There were on the order of 20-30 MS+VS+.NET related programs, and I uninstalled about 15.

大概有20-30个MS + VS + .NET相关程序,我卸载了大约15个。

I can't remember exactly which one I uninstalled, but it was anything that look remotely old and related to VS or .NET. Even if it was recent, I always figured I could reinstall stuff if I got the wrong thing.

我不记得我卸载了哪一个,但是它看起来很遥远,与VS或.NET有关。即使它是最近的,我总是认为如果我弄错了,我可以重新安装。

Hopefully, anyone going through a similar issue will find this helpful. Good luck.

希望任何经历过类似问题的人都会觉得这很有帮助。祝好运。

#2


0  

Had the same issue, installing

有同样的问题,安装

AspNetWebTools2013_1Setup.exe

WebToolsExtensionsVS.msi

fixed it for me.

为我修好了。

Link Here

#1


0  

I believe I have solved the issue, but I don't know exactly what I did.

我相信我已经解决了这个问题,但我不确切知道我做了什么。

上下文菜单没有“添加脚手架”或“添加控制器”选项

One answer from here was part of what prompted me to uninstall a number of MS products and features. Unfortunately, I can't remember the exact program or feature I uninstalled.

这里的一个答案是促使我卸载大量MS产品和功能的部分原因。不幸的是,我不记得我卸载的确切程序或功能。

It seems like the uninstalling of related programs and features fixed the issue. By "related programs and features" I mean anything in the Control Panel > All Control Panel Items > Programs and Features menu that had ".NET" or "Visual Studio" or "Microsoft * Web Tools" or of the like. Many of them required a system reboot after uninstalling, and after one system reboot, the desired features in VS2013 was there.

似乎卸载相关程序和功能解决了这个问题。 “相关程序和功能”是指“控制面板”>“所有控制面板项目”>“程序和功能”菜单中包含“.NET”或“Visual Studio”或“Microsoft * Web工具”等的任何内容。其中许多需要在卸载后重新启动系统,并且在一次系统重启后,VS2013中的所需功能就在那里。

There were on the order of 20-30 MS+VS+.NET related programs, and I uninstalled about 15.

大概有20-30个MS + VS + .NET相关程序,我卸载了大约15个。

I can't remember exactly which one I uninstalled, but it was anything that look remotely old and related to VS or .NET. Even if it was recent, I always figured I could reinstall stuff if I got the wrong thing.

我不记得我卸载了哪一个,但是它看起来很遥远,与VS或.NET有关。即使它是最近的,我总是认为如果我弄错了,我可以重新安装。

Hopefully, anyone going through a similar issue will find this helpful. Good luck.

希望任何经历过类似问题的人都会觉得这很有帮助。祝好运。

#2


0  

Had the same issue, installing

有同样的问题,安装

AspNetWebTools2013_1Setup.exe

WebToolsExtensionsVS.msi

fixed it for me.

为我修好了。

Link Here