Add Controller Model Classes not shown

后端 未结 14 860
天命终不由人
天命终不由人 2020-12-31 09:41

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

14条回答
  •  青春惊慌失措
    2020-12-31 10:16

    "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.

提交回复
热议问题