ASP.NET MVC Add Controller Disabled

I am using Visual Studio 2013 for websites with MVC 5.

When I try to add a new controller to the "Controllers" card in my project, here's what I do: right-click controllers, Add, New Scaffolded Item, "MVC 5 Controller with Views Using EE". I populate the controller name, model class, etc. But the "Add" button is inactive.

  • Project selected.
  • I'm not in debug mode
  • I can add a class to the Models folder
+5
source share
4 answers

The ability to add a new controller will not be available if your project is currently running. Stop execution and the option described by you will become available.

+6
source

I believe that a model should be created before adding forests. I am sure this works if you select an existing model.

+1
source

Why not just click Add> Controller .. or if for some reason it’s not there Add> New item ..> MVC 4 controller class

Is there any specific reason why you are an MVC 5 controller with views using EE , because on my VS 2013 I don't even see this option?

0
source

First add a model class Add a new forest element Attach a new model class Follow the pop-up window and the Add button will become available.

0
source

Source: https://habr.com/ru/post/1208917/


All Articles