2

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

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks bro. I had checked the project name in the Browse section only. Now I did as per your answer and the problem is solved.
0

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

Comments

0

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"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.