I managed to create a Model First DBContext model (before it was a normal ObjectContext derived model).
Strangly now my VS is not showing ANY of my classes in the Mo
Had the same problem. I fixed it.
This problem can occur when you have a project referencing another project. This is called a transitive project reference and manifests in a number of ways, one of which is this. You need to directly reference projects and not transitively to resolve this in some cases.
eg: Project A , project B, Project C
Project B has a reference to C so in repos/b/bin/debug you have b.dll and c.dll Project A needs both so you point the reference to B.dll and C.dll in the b/bin/debug folder. If you do this you can't see any models from c.dll but you can see the b.dll models.
fix/workaround: reference repos/b/bin/debug/b.dll and repos/c/bin/debug/c.dll directly
Finally I managed to get the scaffolding working again. I refactored my model.edmx out of the main project. The templating stuff will now generate the model classes in this new model project. After adding the model project to the main project, the classes are showing up in the controller model selectbox again. Strange as it seems to work in a completely new set-up solution without separation...
"Add Controller" Model Classes not shown for scaffolding
Environment Used: ASP.NET MVC5 using C# Visual Studio 2013
Solution 1: If solution name is SAME as project name, just clean solution, Build Solution. It will work.
Solution 2: If solution name is DIFFERENT from project name, then check below steps:
(i) Check your model class(s) namespace as
namespace SolutionName.ProjectName.Models
{ ...}
suppose solution name is "WGT" and project name is "MS", then models class say User should be
namespace WGT.MS.Models
{ public class User{...}}
(ii) After this, clear solution.
(iii) Build Solution
It will surely work. Found this solution after spending a lot of time. It's a practical and implemented solution.
I got the same issue , Check the package (asp.net mvc, & EF ) compatibility , upgrade all nuget packages. clean and Rebuild project. That works for me.
http://forums.asp.net/t/1791616.aspx?Can+t+create+new+controller+No+model+classes+are+available+
I had this same issue with one specific model. I was using .Net Core 2.x with EF Core. Turned out it was because it was inheriting a class which was, in turn, inheriting Microsoft.AspNetCore.Identity.IdentityUser. EF Core will not let me scaffold from that model. I removed the inheritance of IdentityUser from the base class and the model appeared in the dropdown for EF new Controller.