Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP MVC 5 project 'New Scaffolded Item...' is missing from the context menu

This is not a duplicate. See my comments, and also see my additional diag. results

edit Now it is became more weird. Next morning I've opened my VS and this project, and Scaffolding menu items were there. Used them for a few times, then it disappeared. I thought I did something in the project so source control undo all: Not helped. VS close/open: Not helped. Machine restart: Not helped. Creating a brand new ASP MVC 5 project, that project also do not have any MVC like contect menu, neither right clicking on Controllers or Views: Not helped. This is scary. But besides of scary I am practically disabled in my work :-( Do anybody have any idea what's going on? edit

Using VS 2013 update 3 I've created a new ASP MVC 5 project. Right clicking in the Controllers folder in the Solution Explorer, the 'New Scaffolded Item...' is missing from the context menu. Btw the Add Controller is also missing. See attached pic.

Additional diag results:

1) The very same solution transferred to an other machine works as expected. The solution was transferred via source control, so it is the same .csproj file (well .csproj.user can differ)

2) The solution we talking about was created in my machine, which exhibits the issue

3) If I repeat the experiment, creating a new ASP MVC 5 Web app in my machine, the context menu is missing.

Context menu for Controllers folder

What am I missing? Thx in advance

like image 267
g.pickardou Avatar asked Sep 18 '14 09:09

g.pickardou


2 Answers

I know it's a rather old pos, but I had the same problem and found a solution which worked in my case, which I wanted to share.

I had to update my NuGet Packages on the project before I had the entry "new Scaffolded item".

You do it like so: Right click on project -> Manage NuGet Packages -> There you update "Microsoft ASP.NET Web Pages" and "Microsoft ASP.NET MVC"

Now I had the entry in the context menu

Regards Christian

like image 157
Christian Avatar answered Oct 22 '22 18:10

Christian


All you need is add the following entries to your project.json file

    Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    }
  }
like image 22
Ibrahim Mohammed Avatar answered Oct 22 '22 19:10

Ibrahim Mohammed