Visual Studio "Add Controller" Model Class List

The Add Controller dialog box in the MVC project provides a drop-down list of model classes to choose from. Usually these are model classes in a project, and this is what I saw. But now I get this:

Add Controller dialog in Visual Studio

Any idea what is wrong and how to change it to what I think is normal?

+7
source share
2 answers

There seems to be no solution to this problem. This dialog box shows classes from all classes in the solution and includes any third-party classes that have been imported (using something like NuGet). What is the point. So this is a feature, not a mistake.

A workaround for sifting through this entire list is to use the autocomplete functionality built into this dialog, making it easy to find the required fully qualified class name.

+1
source

I often have a problem with this “forget” classes dialog box and showing odd variations. Closing and restarting VS always fixed the issue for me.

+1
source

All Articles