Why is my data context class missing from the drop-down when I choose Add Controller?

asp.net-core asp.net-core-2.0 c# entity-framework entity-framework-6

Question

My ASP.Net core 2.0 project (LF.Web) references my EF6 data project (LF.Data). The data context and model classes live in the data project. The controllers are in the Web project. When I right-click on the Controllers folder in LF.Web and select "Add Contoller..." then choose "MVC Controller with views, using Entity Framework" I find an empty drop-down box containing no data context class (from LF.Data). Why? Is it because I'm using Entity Framework 6 and not Entity Framework Core? Is it because the context is not in the same project? Can you offer any suggestions on how to get this working? Note: The "Model class:" drop-down also does not show my model class from the other project.

enter image description here

This project is already successfully using multiple controllers referencing my one context class and it has multiple model entities. I've not tried to use the built in Add Scaffold wizard until now.

1
1
11/2/2017 6:40:52 PM

Popular Answer

I had the exact same issue with empty drop downs and resolved it by simply restarting Visual Studio.

0
10/30/2018 7:14:47 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow