Visual Studio “Add Controller” list of model classes

≯℡__Kan透↙ 提交于 2019-12-07 01:38:42

问题


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:

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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/5890919/visual-studio-add-controller-list-of-model-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!