Farinha
Farinha

Reputation: 18091

Visual Studio "Add Controller" list of model classes

The "Add Controller" dialog on an MVC project provides a dropdown list of model classes to choose from. These are usually the model classes in the project, and that's what I used to see. But now I'm getting this:

Add Controller dialog in Visual Studio

Any idea what's wrong and how to change it back to what I believe is the normal way?

Upvotes: 7

Views: 1479

Answers (2)

Farinha
Farinha

Reputation: 18091

It seems there's no solution to this problem. That dialog shows the classes from all the classes in the solution, and that includes any 3rd party classes that were imported (using something like NuGet). Which kind of makes sense. So it's a feature, not a bug.

The workaround to sifting through that whole list is to take advantage of the autocomplete functionality built into that dialog, which makes it quite easy to find the required full class name.

Upvotes: 1

user553671
user553671

Reputation:

I often run into a problem with that dialog box "forgetting" classes and showing odd choices. Closing and restarting VS has always cleared the problem up for me.

Upvotes: 1

Related Questions