Avishekh Bharati
Avishekh Bharati

Reputation: 1918

ASP.NET MVC , Add View : No model classes in dropdownlist

I had problem with data-migrations yesterday. Which somehow I solved it. This is how I solved:
ASP.NET MVC : Context type not found in assembly . Everything was working fine before this migration problem.

Now today when I try to add a view in my controller's methods. The "Model class" drop-down list doesn't show any model. enter image description here

Project Structure and details:

I have two projects in my solution: "FYPPharmAssistant" and "FYPPharmAssistant.Domain".

FYPPharmAssistant.Domain is class library consisting all my entities and database context classes. FYPPharmAssistant consists of UI and controllers. I am using ASP.NET MVC 5, EF 6 and codefirst approach.

I also have one confusion. Isn't the dll file of FYPPharmAssistant.Domain which is refernced in the 1st project needs to be updated with every build? The modified date is 1 day back. But by now I have modified lots of things in my models.

It has been 36 hours and the modified date hasn't been updated yet. enter image description here

Upvotes: 2

Views: 1156

Answers (3)

MLx
MLx

Reputation: 1

Are you sure your to project are configure to Build when you build your solution ? Go to "Build/Configuration Manager..." and be sure your 2 projects are check for "Build"

Upvotes: 0

suraj shakya
suraj shakya

Reputation: 1

Bro! First Build FYPPharmAssistant.Domain project Then Add the Reference of FYPPharmAssitant.Domain to you project

Upvotes: 0

Iraj
Iraj

Reputation: 1522

In "FYPPharmAssistant" project , you should add refrence to "FYPPharmAssistant.Domain" project ,and you dont add dll refrence to project.

In Add refrence window ,in left side of window ,choose Solution => Projects and in the right side selected "FYPPharmAssistant.Domain" then click ok.

Also after every change in model ,first build project.

Upvotes: 2

Related Questions